GNOME Bugzilla – Bug 701121
GTK+ programs fail to run on Windows possibly due to GdkDisplay/GdkScreen updates
Last modified: 2013-06-07 11:21:58 UTC
Hi, It seems that there were some changes lately to the 3.9.x series to GdkDisplay/GdkScreen that required an update to the GDK Win32 backend as running the gtk3-demo program gave me the following message: (gtk3-demo.exe:8828): Gdk-CRITICAL **: file ..\..\..\gdk\gdkscreen.c: line 879: assertion 'GDK_IS_SCREEN (screen)' failed, which was triggered by the line: window->depth = gdk_visual_get_system ()->depth; (in function _gdk_windowing_window_init() in gdkwindow-win32.c). This function is called by _gdk_windowing_window_init (_gdk_screen); in _gdk_win32_display_open() in gdkdisplay-win32.c. Might be of notice, it also seems that during _gdk_win32_display_open(), _gdk_display would always be NULL even if I try to run do gdk_display_get_default() on it; I am trying still to investigate the possible cause of this, hence opening a bug report for this. With blessings, thank you!
Created attachment 245613 [details] [review] GDK-Win32: Avoid gdk_screen_get_default() calls before the display is opened Hi, Upon further investigation, it seems that the cause of this problem is due to the use of gdk_screen_get_default() before the display is opened, which would cause an invalid GdkScreen pointer to be returned by it. I have came up with a patch that addresses this issue, by using the screen that is acquired from the current display instead of the one returned by gdk_screen_get_default(), like patch e61df371 for Wayland (Prevent criticals when initializing a Wayland display). This fixes the issue for me and gtk3-demo runs normally after fixing this. With blessings, thank you!
There is a patch for this also in https://bugzilla.gnome.org/show_bug.cgi?id=700444
Hi Jose, Thanks for the note. It does seem to me that LRN's patches does more or less the same thing to tackle this issue, so we can hopefully get the patch(es) into GTK+ master so that GTK+ master can run again normally on Windows. With blessings.
*** This bug has been marked as a duplicate of bug 700444 ***