xwayland: Recurse on finding the none-wm owner
An X11 window manager might add a chain of parent windows when reparenting to a decoration window. That is for example the case for KWin, which reparents client windows to one decoration and another wrapper parent window. Account for that by a recursion into the tree. For now assume as before that all X11 window managers reparent with one child only for these parent windows. Changes by Hans de Goede: - Move the xwl_window_is_toplevel() from a later patch in this series here as it really belongs together with these changes - Drop no longer necessary xwl_window argument from window_get_none_wm_owner parameters Signed-off-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
948e02872f
commit
a69f7fbb54
|
@ -247,19 +247,18 @@ window_is_wm_window(WindowPtr window)
|
||||||
}
|
}
|
||||||
|
|
||||||
static ClientPtr
|
static ClientPtr
|
||||||
xwl_window_get_owner(struct xwl_window *xwl_window)
|
window_get_none_wm_owner(WindowPtr window)
|
||||||
{
|
{
|
||||||
WindowPtr window = xwl_window->window;
|
|
||||||
ClientPtr client = wClient(window);
|
ClientPtr client = wClient(window);
|
||||||
|
|
||||||
/* If the toplevel window is owned by the window-manager, then the
|
/* If the toplevel window is owned by the window-manager, then the
|
||||||
* actual client toplevel window has been reparented to a window-manager
|
* actual client toplevel window has been reparented to some window-manager
|
||||||
* decoration window. In that case return the client of the
|
* decoration/wrapper windows. In that case recurse by checking the client
|
||||||
* first *and only* child of the toplevel (decoration) window.
|
* of the first *and only* child of the decoration/wrapper window.
|
||||||
*/
|
*/
|
||||||
if (window_is_wm_window(window)) {
|
if (window_is_wm_window(window)) {
|
||||||
if (window->firstChild && window->firstChild == window->lastChild)
|
if (window->firstChild && window->firstChild == window->lastChild)
|
||||||
return wClient(window->firstChild);
|
return window_get_none_wm_owner(window->firstChild);
|
||||||
else
|
else
|
||||||
return NULL; /* Should never happen, skip resolution emulation */
|
return NULL; /* Should never happen, skip resolution emulation */
|
||||||
}
|
}
|
||||||
|
@ -280,7 +279,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
|
||||||
if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
|
if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
owner = xwl_window_get_owner(xwl_window);
|
owner = window_get_none_wm_owner(xwl_window->window);
|
||||||
if (!owner)
|
if (!owner)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -350,8 +349,8 @@ xwl_window_is_toplevel(WindowPtr window)
|
||||||
if (window_get_damage(window))
|
if (window_get_damage(window))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Normal toplevel client windows, reparented to decoration window */
|
/* Normal toplevel client windows, reparented to a window-manager window */
|
||||||
return (window->parent && window_get_damage(window->parent));
|
return window->parent && window_is_wm_window(window->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue