From ca3256ee97d4d61649e90120d4f2905199cd1d70 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 7 Aug 2023 17:30:39 +0200 Subject: [PATCH] backends/x11: Rename function to reset X11 cached current monitor info This is done from the backend X11 connection, but needs directing at times from the frontend X11 connection. Commit 5a8509f89503 added a XEvent argument presumably for possible future expansions that did never come. Since this function is nothing about events, drop the XEvent argument and make the name a little bit more ad-hoc (according to what it does, at least). Part-of: --- src/backends/x11/meta-backend-x11.c | 9 ++++----- src/backends/x11/meta-backend-x11.h | 5 ++--- src/x11/events.c | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index 6fe6a7ee6..3ed2830a3 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -523,9 +523,8 @@ on_monitors_changed (MetaMonitorManager *manager, MetaBackend *backend) { MetaBackendX11 *x11 = META_BACKEND_X11 (backend); - MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11); - priv->cached_current_logical_monitor = NULL; + meta_backend_x11_reset_cached_logical_monitor (x11); } static void @@ -801,10 +800,10 @@ meta_backend_x11_get_keymap_layout_group (MetaBackend *backend) } void -meta_backend_x11_handle_event (MetaBackendX11 *x11, - XEvent *xevent) +meta_backend_x11_reset_cached_logical_monitor (MetaBackendX11 *backend_x11) { - MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11); + MetaBackendX11Private *priv = + meta_backend_x11_get_instance_private (backend_x11); priv->cached_current_logical_monitor = NULL; } diff --git a/src/backends/x11/meta-backend-x11.h b/src/backends/x11/meta-backend-x11.h index a4480777d..698f828fb 100644 --- a/src/backends/x11/meta-backend-x11.h +++ b/src/backends/x11/meta-backend-x11.h @@ -55,9 +55,6 @@ Window meta_backend_x11_get_root_xwindow (MetaBackendX11 *backend_x11); Window meta_backend_x11_get_xwindow (MetaBackendX11 *backend); -void meta_backend_x11_handle_event (MetaBackendX11 *x11, - XEvent *xevent); - uint8_t meta_backend_x11_get_xkb_event_base (MetaBackendX11 *x11); void meta_backend_x11_reload_cursor (MetaBackendX11 *x11); @@ -65,3 +62,5 @@ void meta_backend_x11_reload_cursor (MetaBackendX11 *x11); void meta_backend_x11_sync_pointer (MetaBackendX11 *backend_x11); MetaX11Barriers * meta_backend_x11_get_barriers (MetaBackendX11 *backend_x11); + +void meta_backend_x11_reset_cached_logical_monitor (MetaBackendX11 *backend_x11); diff --git a/src/x11/events.c b/src/x11/events.c index d432b270f..d65ea08a6 100644 --- a/src/x11/events.c +++ b/src/x11/events.c @@ -1922,7 +1922,7 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display, display->current_time = event_get_time (x11_display, event); if (META_IS_BACKEND_X11 (backend)) - meta_backend_x11_handle_event (META_BACKEND_X11 (backend), event); + meta_backend_x11_reset_cached_logical_monitor (META_BACKEND_X11 (backend)); if (x11_display->focused_by_us && event->xany.serial > x11_display->focus_serial &&