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 775319 - [Wayland]: gdk_window_get_toplevel() fails to return the toplevel of a child subsurface
[Wayland]: gdk_window_get_toplevel() fails to return the toplevel of a child ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 774475
Blocks: 774546
 
 
Reported: 2016-11-29 13:21 UTC by Olivier Fourdan
Modified: 2016-11-30 09:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH gtk-3-22] wayland: Check for subsurface looking up the toplevel (8.02 KB, patch)
2016-11-29 13:25 UTC, Olivier Fourdan
none Details | Review
[PATCH gtk-3-22] wayland: Check for subsurface looking up the toplevel (989 bytes, patch)
2016-11-29 13:39 UTC, Olivier Fourdan
committed Details | Review

Description Olivier Fourdan 2016-11-29 13:21:35 UTC
Description:

Creating a gdk window subsurface with another gdk window as parent generates critical warnings:

  GLib-GObject-WARNING **: invalid (NULL) pointer instance
  GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
  GLib-GObject-WARNING **: invalid (NULL) pointer instance
  GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

Those are coming from _gdk_wayland_display_create_window_impl() because gdk_window_get_frame_clock() returns NULL.

gdk_window_get_frame_clock() tries to get the frame clock from the toplevel, by walking the window tree back to the corresponding top level.

Unfortunately, it does so by checking the window_type to be GDK_WINDOW_CHILD whereas it can also be a GDL_WINDOW_SUBSURFACE now (bug 774475).

Since it cannot find the correct toplevel window, it returns NULL as the clock frame, which then causes the critical warnings in _gdk_wayland_display_create_window_impl()

Trivial patch to follow.
Comment 1 Olivier Fourdan 2016-11-29 13:25:09 UTC
Created attachment 340971 [details] [review]
[PATCH gtk-3-22] wayland: Check for subsurface looking up the toplevel
Comment 2 Olivier Fourdan 2016-11-29 13:26:00 UTC
Same patch applies cleanly on master as well.
Comment 3 Olivier Fourdan 2016-11-29 13:39:17 UTC
Created attachment 340973 [details] [review]
[PATCH gtk-3-22] wayland: Check for subsurface looking up the toplevel

(attach the correct patch for gtk+ this time!)
Comment 4 Jonas Ådahl 2016-11-30 08:58:48 UTC
Review of attachment 340973 [details] [review]:

Looks reasonable to me.
Comment 5 Jonas Ådahl 2016-11-30 08:58:50 UTC
Review of attachment 340973 [details] [review]:

Looks reasonable to me.
Comment 6 Olivier Fourdan 2016-11-30 09:09:20 UTC
Comment on attachment 340973 [details] [review]
[PATCH gtk-3-22] wayland: Check for subsurface looking up the toplevel

attachment 340973 [details] [review] pushed to master as commit bd45199 - [PATCH] wayland: Check for subsurface looking up the toplevel

attachment 340973 [details] [review] pushed to branch gtk-3-22 as commit 57a1456 - [PATCH] wayland: Check for subsurface looking up the toplevel