[Geany-Devel] Geany with gtk+ 3.6.4 under Windows
Matthew Brush
mbrush at xxxxx
Wed Jun 18 00:34:22 UTC 2014
On 14-06-17 09:28 AM, Dimitar Zhekov wrote:
> Hi,
>
> Taking point from "[Geany-Users] I can't see highlighted item in menu",
> here are some results of compiling and running Geany under Windows
> with the official gtk+3.6.4 binary:
>
> 1. Compiles and install normally (waf build system).
>
> 2. On start, if at least 1 file was open, crashes with:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x006e4340 in gdk_window_has_impl () from c:\tmp\scp\gtk+\bin
> \libgdk-3-0.dll (gdb) bt
> #0 0x006e4340 in gdk_window_has_impl ()
> from c:\tmp\scp\gtk+\bin\libgdk-3-0.dll
> #1 0x006e4388 in _gdk_window_has_impl ()
> from c:\tmp\scp\gtk+\bin\libgdk-3-0.dll
> #2 0x0071898e in gdk_win32_window_get_handle ()
> from c:\tmp\scp\gtk+\bin\libgdk-3-0.dll
> #3 0x0045e998 in win32_get_shortcut_target ()
> #4 0x00428992 in document_open_file_full ()
> #5 0x00408758 in open_session_file ()
> #6 0x00408886 in configuration_open_files ()
> #7 0x0045ff75 in load_startup_files ()
> #8 0x0046047f in main ()
>
> The problem is in GDK_WINDOW_HWND(gtk_widget_get_window
> (main_widgets.window)), used to compute HWND to serve as parent
> window when resolving a link, if this happens to require UI. On link
> target missing, Win~1 searches for "similar" files, displaying a small
> dialog, and sometimes asks whether file X is the missing link.
>
> I coudn't get a proper HWND for Geany main window. Using
> gdk_win32_window_get_handle(gdk_get_default_root_window()) works,
> but the link UI may (or may not?) be displayed below the Geany
> window, looking as if we blocked.
>
> A possible solution would be to use some Windows API directly, for
> example GetActiveWindow().
>
There's tons of bug reports about crashers on a number of different
platforms when you search Google for "gdk_window_has_impl" (with and
without leading underscore), seems like it does/did miss a NULL check or
such. My first thought is that we try to access the native window handle
before it has actually been allocated (eg. before a map event or
whichever event fires once window resources have been allocated), but
it's just an idea. Maybe trying to do `gtk_widget_map(win)` (or
whichever is the correct function) before trying to access the HWND
would fix/hide the bug?
> 3. The items under cursor are not always highlighted. For example,
> when I open Edit and move the mouse, the menu items are highlighted
> fine, except for Preferences, which may or may not be highlighted.
>
I never noticed this when using GTK3 on Windows, but it's possible it
happened and I just didn't notice. Maybe there's something weird about
that particular menu item, like that we have one below it who's
sensitivity changes depending on runtime conditions, or the current UI
language/translation string, etc. It'd be interesting to move the menu
item up to the top of the menu, try changing the stock/icon/labels,
removing accelerator, etc. to see why only one item acts weird.
> 4. The second and especially the third tab in the About dialog cause
> 100% CPU load and blocking.
>
IIRC we have some weird stuff in those tabs, custom wrapping widgets
which are no longer needed for GTK3, etc. Even on Linux the "Credits"
tab is fairly broken, it doesn't allow selection, context menu, etc. IMO
we should move this whole dialog to Glade, just use a plain GtkTextView
and add all the names into the Glade file instead of loading from static
arrays and doing all the markup formatting using string/markup
functions, etc or just use GtkAboutDialog (properly).
Related fact: Skimming the Git history, I was the last developer
contributor added to the About dialog in 2011 :) (translation
contributors seems to have more recent updates though). I wonder if we
could/should generate this list from Git log?
> 5. The waf build of geany plugins does not currently support gtk+3.
>
Not a problem with GTK3, just a matter of those using/responsible for
Waf to update the build system. Probably the quickest way to get this
resolved is to start shipping Geany for Windows releases with GTK3 so it
has to be done for plugins to work, otherwise probably nobody will take
the initiative until Geany core bumps min. to GTK3, and in the meantime
nobody will be testing Geany or plugins on GTK3 in order to resolve
quirks like you're finding.
> Wikipedia calls gtk+3.4 "the first version of GTK+ 3 that works well
> on Windows", but that seems to be an overstatement. Maybe 3.10+ with
> the changed event loop and drawing will be better. Or worse...
>
It might be assuming the "works well" is for applications coded against
GTK3, fully using the framework supporting the toolkit, not trying to
support gtk2 and 3 at the same time, and that don't have almost a decade
of cruft built up to work around issues which may or may not even exist
anymore in the toolkit or/on the supported Windows versions :)
> For now, we'd better stick to gtk+2 under Windows.
>
Even better would be to find out what is causing the problems and fix
the issues, most likely the stuff is going to be things we did slightly
weird in GTK2 that is no longer needed or doesn't work exactly the same
with GTK3. If we hold off switching to bundled version to GTK3, nobody
will use it and it won't get tested or fixed.
IMO it would be great to put "beta" releases/installers for Windows on
the website for download so that more people can be testing with GTK3
bundle without having to compile from scratch (far too painful for most
users to do), and then we won't end up deciding at some later release
date to just switch it and hope for the best.
BTW, which Windows version and which GTK+ architecture bundle (32/64)
are you using, in case I get a chance to try and reproduce?
Cheers,
Matthew Brush
More information about the Devel
mailing list