diff options
author | Bilal Elmoussaoui <belmouss@redhat.com> | 2022-06-01 10:45:20 +0200 |
---|---|---|
committer | Bilal Elmoussaoui <belmouss@redhat.com> | 2022-08-02 09:51:54 +0200 |
commit | c21e19b1414788ea032066165052a4c8af6ebfb7 (patch) | |
tree | 5b1d956cd3a3d36979c4faa77a8649f7783a907f | |
parent | b85acbcce9861a63af24ec6312b33d8dc1d81f39 (diff) | |
download | mutter-c21e19b1414788ea032066165052a4c8af6ebfb7.tar.gz |
wayland: Move surface check to MetaWaylandSurface
-rw-r--r-- | src/wayland/meta-wayland-cursor-surface.c | 2 | ||||
-rw-r--r-- | src/wayland/meta-wayland-pointer-constraints.c | 8 | ||||
-rw-r--r-- | src/wayland/meta-wayland-surface.c | 9 | ||||
-rw-r--r-- | src/wayland/meta-wayland-surface.h | 2 | ||||
-rw-r--r-- | src/wayland/meta-xwayland-dnd.c | 2 | ||||
-rw-r--r-- | src/wayland/meta-xwayland.c | 9 | ||||
-rw-r--r-- | src/wayland/meta-xwayland.h | 3 |
7 files changed, 17 insertions, 18 deletions
diff --git a/src/wayland/meta-wayland-cursor-surface.c b/src/wayland/meta-wayland-cursor-surface.c index 87d55535c..da8bd17d1 100644 --- a/src/wayland/meta-wayland-cursor-surface.c +++ b/src/wayland/meta-wayland-cursor-surface.c @@ -89,7 +89,7 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite, MetaWaylandSurfaceRole *role = META_WAYLAND_SURFACE_ROLE (cursor_surface); MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (role); - if (!meta_xwayland_is_xwayland_surface (surface)) + if (!meta_wayland_surface_is_xwayland (surface)) { MetaBackend *backend = meta_get_backend (); MetaMonitorManager *monitor_manager = diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c index df460f9bf..0559de220 100644 --- a/src/wayland/meta-wayland-pointer-constraints.c +++ b/src/wayland/meta-wayland-pointer-constraints.c @@ -187,7 +187,7 @@ surface_constraint_data_new (MetaWaylandSurface *surface) connect_window (data, window); } #ifdef HAVE_XWAYLAND - else if (meta_xwayland_is_xwayland_surface (surface)) + else if (meta_wayland_surface_is_xwayland (surface)) { data->window_associated_handler_id = g_signal_connect (surface->role, "window-associated", @@ -469,7 +469,7 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint) * associate the X11 Window with the wl_surface. */ #ifdef HAVE_XWAYLAND - g_warn_if_fail (meta_xwayland_is_xwayland_surface (constraint->surface)); + g_warn_if_fail (meta_wayland_surface_is_xwayland (constraint->surface)); #endif return FALSE; } @@ -481,7 +481,7 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint) return FALSE; #ifdef HAVE_XWAYLAND - if (meta_xwayland_is_xwayland_surface (constraint->surface)) + if (meta_wayland_surface_is_xwayland (constraint->surface)) { MetaDisplay *display = meta_get_display (); @@ -627,7 +627,7 @@ meta_wayland_pointer_constraint_calculate_effective_region (MetaWaylandPointerCo int actual_width, actual_height; #ifdef HAVE_XWAYLAND - g_assert (meta_xwayland_is_xwayland_surface (constraint->surface)); + g_assert (meta_wayland_surface_is_xwayland (constraint->surface)); #endif actual_width = window->buffer_rect.width - (frame->child_x + frame->right_width); diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 2279e894b..fcb1c2d9b 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -2268,3 +2268,12 @@ meta_wayland_surface_get_geometry_scale (MetaWaylandSurface *surface) actor_surface = META_WAYLAND_ACTOR_SURFACE (surface->role); return meta_wayland_actor_surface_get_geometry_scale (actor_surface); } + +gboolean +meta_wayland_surface_is_xwayland (MetaWaylandSurface *surface) +{ + MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); + MetaXWaylandManager *manager = &compositor->xwayland_manager; + + return wl_resource_get_client (surface->resource) == manager->client; +} diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 2f8c9bd11..995ecf889 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -371,6 +371,8 @@ meta_wayland_surface_can_scanout_untransformed (MetaWaylandSurface *surface, int meta_wayland_surface_get_geometry_scale (MetaWaylandSurface *surface); +gboolean meta_wayland_surface_is_xwayland (MetaWaylandSurface *surface); + static inline GNode * meta_get_next_subsurface_sibling (GNode *n) { diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c index 0aa4c5efb..ecd84f331 100644 --- a/src/wayland/meta-xwayland-dnd.c +++ b/src/wayland/meta-xwayland-dnd.c @@ -987,7 +987,7 @@ meta_xwayland_dnd_handle_xfixes_selection_notify (MetaWaylandCompositor *composi focus = compositor->seat->pointer->focus_surface; if (event->owner != None && event->owner != x11_display->selection.xwindow && - focus && meta_xwayland_is_xwayland_surface (focus)) + focus && meta_wayland_surface_is_xwayland (focus)) { dnd->source = meta_wayland_data_source_xwayland_new (dnd); meta_wayland_data_device_set_dnd_source (&compositor->seat->data_device, diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 968467558..ba412f592 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -131,15 +131,6 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window, } } -gboolean -meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface) -{ - MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); - MetaXWaylandManager *manager = &compositor->xwayland_manager; - - return wl_resource_get_client (surface->resource) == manager->client; -} - static gboolean try_display (int display, char **filename_out, diff --git a/src/wayland/meta-xwayland.h b/src/wayland/meta-xwayland.h index cbe27b183..06f68ea2d 100644 --- a/src/wayland/meta-xwayland.h +++ b/src/wayland/meta-xwayland.h @@ -39,9 +39,6 @@ void meta_xwayland_handle_wl_surface_id (MetaWindow *window, guint32 surface_id); -gboolean -meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface); - void meta_xwayland_handle_xwayland_grab (MetaWindow *window, gboolean allow); |