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 736269 - GTK crashes when gdk_window_get_root_coords() is called on a foreign window
GTK crashes when gdk_window_get_root_coords() is called on a foreign window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-09-08 15:25 UTC by LRN
Modified: 2014-09-08 15:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initialize impl_window for foreign W32 windows (998 bytes, patch)
2014-09-08 15:25 UTC, LRN
none Details | Review
A testcase (1.88 KB, text/x-c)
2014-09-08 15:26 UTC, LRN
  Details
Initialize impl_window for foreign W32 windows (1.00 KB, patch)
2014-09-08 15:52 UTC, LRN
committed Details | Review

Description LRN 2014-09-08 15:25:28 UTC
This happens because gdk_window_get_root_coords() calls:
> impl_class->get_root_coords (window->impl_window, ...
and window->impl_window is NULL
Comment 1 LRN 2014-09-08 15:25:33 UTC
Created attachment 285653 [details] [review]
Initialize impl_window for foreign W32 windows
Comment 2 LRN 2014-09-08 15:26:13 UTC
Created attachment 285654 [details]
A testcase
Comment 3 Ignacio Casal Quinteiro (nacho) 2014-09-08 15:38:05 UTC
Review of attachment 285653 [details] [review]:

See the comment

::: gdk/win32/gdkwindow-win32.c
@@ +718,3 @@
     g_list_prepend (window->parent->impl_window->native_children, window);
 
+  window->impl_window = g_object_ref (window->parent->impl_window);

what about window->impl_window = window ?
for what I can see on x11 is what it is doing...
Comment 4 LRN 2014-09-08 15:44:33 UTC
That fixes the crash too.
Comment 5 LRN 2014-09-08 15:52:48 UTC
Created attachment 285655 [details] [review]
Initialize impl_window for foreign W32 windows

v2: Use foreign window's own impl, not its parent's
Comment 6 LRN 2014-09-08 15:56:39 UTC
Attachment 285655 [details] pushed as a8915b8 - Initialize impl_window for foreign W32 windows