wayland: Check for subsurface looking up the toplevel

gdk_window_get_toplevel() walks up the windows tree looking for the
corresponding toplevel window, but needs to account for subsurfaces as
well on Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=775319
This commit is contained in:
Olivier Fourdan 2016-11-29 14:21:57 +01:00
parent 197eaaacb7
commit 57a14565c6

View File

@ -2454,7 +2454,8 @@ gdk_window_get_toplevel (GdkWindow *window)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
while (window->window_type == GDK_WINDOW_CHILD)
while (window->window_type == GDK_WINDOW_CHILD ||
window->window_type == GDK_WINDOW_SUBSURFACE)
{
if (gdk_window_is_toplevel (window))
break;