summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mader <robert.mader@collabora.com>2022-11-02 19:36:11 +0100
committerFlorian Müllner <fmuellner@gnome.org>2023-03-19 21:45:14 +0000
commite7a538cb21debe6d1453f00b7364aa437238f65a (patch)
tree60c5c00ea38ba4a7223af5f9627d0a157aaee4c4
parent240f003b242106f77c9e563647d96c7ea09ade5e (diff)
downloadmutter-e7a538cb21debe6d1453f00b7364aa437238f65a.tar.gz
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> (cherry picked from commit 08a4caff6f89d1b8f1fd614ef02b6ca49f1e8c98)
-rw-r--r--src/wayland/meta-wayland-pointer-constraints.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c
index 965b95dda..598b5fcd2 100644
--- a/src/wayland/meta-wayland-pointer-constraints.c
+++ b/src/wayland/meta-wayland-pointer-constraints.c
@@ -39,6 +39,7 @@
#include "wayland/meta-wayland-private.h"
#include "wayland/meta-wayland-region.h"
#include "wayland/meta-wayland-seat.h"
+#include "wayland/meta-wayland-subsurface.h"
#include "wayland/meta-wayland-surface.h"
#include "wayland/meta-xwayland.h"
@@ -193,8 +194,6 @@ surface_constraint_data_new (MetaWaylandSurface *surface)
}
else
{
- /* TODO: Support constraints on non-toplevel windows, such as subsurfaces.
- */
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
* 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;
}