After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701121 - GTK+ programs fail to run on Windows possibly due to GdkDisplay/GdkScreen updates
GTK+ programs fail to run on Windows possibly due to GdkDisplay/GdkScreen upd...
Status: RESOLVED DUPLICATE of bug 700444
Product: gtk+
Classification: Platform
Component: Backend: Win32
3.9.x
Other Windows
: Normal blocker
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-05-28 09:24 UTC by Fan, Chun-wei
Modified: 2013-06-07 11:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDK-Win32: Avoid gdk_screen_get_default() calls before the display is opened (1.95 KB, patch)
2013-05-30 07:55 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2013-05-28 09:24:37 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!
Comment 1 Fan, Chun-wei 2013-05-30 07:55:58 UTC
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!
Comment 2 Jose Rostagno 2013-05-31 19:19:49 UTC
There is a patch for this also in https://bugzilla.gnome.org/show_bug.cgi?id=700444
Comment 3 Fan, Chun-wei 2013-06-01 02:57:28 UTC
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.
Comment 4 Matthias Clasen 2013-06-07 11:21:58 UTC

*** This bug has been marked as a duplicate of bug 700444 ***