wayland/pointer-constraints: Adjustments for subsurface support

After the commit "wayland/subsurface: Implement
meta_wayland_surface_get_window()" subsurfaces are supported. Adjust
some comments and fix a warning that could occur when closing a window.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2717>
This commit is contained in:
Robert Mader 2022-11-02 19:36:11 +01:00 committed by Marge Bot
parent 225f7d46a3
commit 08a4caff6f

View File

@ -39,6 +39,7 @@
#include "wayland/meta-wayland-private.h" #include "wayland/meta-wayland-private.h"
#include "wayland/meta-wayland-region.h" #include "wayland/meta-wayland-region.h"
#include "wayland/meta-wayland-seat.h" #include "wayland/meta-wayland-seat.h"
#include "wayland/meta-wayland-subsurface.h"
#include "wayland/meta-wayland-surface.h" #include "wayland/meta-wayland-surface.h"
#include "wayland/meta-xwayland.h" #include "wayland/meta-xwayland.h"
@ -193,8 +194,6 @@ surface_constraint_data_new (MetaWaylandSurface *surface)
} }
else else
{ {
/* TODO: Support constraints on non-toplevel windows, such as subsurfaces.
*/
g_warn_if_reached (); g_warn_if_reached ();
} }
@ -463,8 +462,10 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
/* /*
* Locks from Xwayland may come before we have had the opportunity to * Locks from Xwayland may come before we have had the opportunity to
* associate the X11 Window with the wl_surface. * associate the X11 Window with the wl_surface.
* For subsurfaces the window of the ancestor might be gone already.
*/ */
g_warn_if_fail (meta_xwayland_is_xwayland_surface (constraint->surface)); g_warn_if_fail (meta_xwayland_is_xwayland_surface (constraint->surface) ||
META_IS_WAYLAND_SUBSURFACE (constraint->surface->role));
return FALSE; return FALSE;
} }