From 3c5bbedb7c81ea5b3ee73662b651cc401ca9657e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 22 Nov 2023 02:03:35 +0100 Subject: [PATCH] compositor: Move code to sync pointer position to backends/x11 Since the backend also knows when did we start/stop being grabbed, we can shuffle this backend-y code to the backend. Part-of: --- src/backends/x11/meta-seat-x11.c | 4 ++++ src/compositor/meta-compositor-x11.c | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c index 32b21cd53..0560a0d77 100644 --- a/src/backends/x11/meta-seat-x11.c +++ b/src/backends/x11/meta-seat-x11.c @@ -1934,6 +1934,8 @@ meta_seat_x11_grab (ClutterSeat *seat, seat_x11->grab_state = state; + meta_backend_x11_sync_pointer (META_BACKEND_X11 (backend)); + return state; } @@ -1959,6 +1961,8 @@ meta_seat_x11_ungrab (ClutterSeat *seat, } seat_x11->grab_state = CLUTTER_GRAB_STATE_NONE; + + meta_backend_x11_sync_pointer (META_BACKEND_X11 (backend)); } static void diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c index 1ad3327dd..218239e93 100644 --- a/src/compositor/meta-compositor-x11.c +++ b/src/compositor/meta-compositor-x11.c @@ -441,23 +441,11 @@ meta_compositor_x11_monotonic_to_high_res_xserver_time (MetaCompositor *composit static void meta_compositor_x11_grab_begin (MetaCompositor *compositor) { - MetaDisplay *display = meta_compositor_get_display (compositor); - MetaContext *context = meta_display_get_context (display); - MetaBackend *backend = meta_context_get_backend (context); - MetaBackendX11 *backend_x11 = META_BACKEND_X11 (backend); - - meta_backend_x11_sync_pointer (backend_x11); } static void meta_compositor_x11_grab_end (MetaCompositor *compositor) { - MetaDisplay *display = meta_compositor_get_display (compositor); - MetaContext *context = meta_display_get_context (display); - MetaBackend *backend = meta_context_get_backend (context); - MetaBackendX11 *backend_x11 = META_BACKEND_X11 (backend); - - meta_backend_x11_sync_pointer (backend_x11); } static MetaCompositorView *