From 3fbeeb90726294352df93b66f673401e8fde5d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 27 Jun 2018 21:30:55 +0200 Subject: [PATCH] backends/x11: Force-update cursor when theme or size changed Force update the cursor renderer after theme or size changes; otherwise we'll be stuck with the old theme and/or size until something else triggers resetting of the cursor. --- src/backends/x11/meta-backend-x11.c | 10 ++++++++++ src/backends/x11/meta-backend-x11.h | 2 ++ src/x11/meta-x11-display.c | 1 + 3 files changed, 13 insertions(+) diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index 7d7910345..9a1f35e6e 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -802,3 +802,13 @@ meta_backend_x11_get_xwindow (MetaBackendX11 *x11) ClutterActor *stage = meta_backend_get_stage (META_BACKEND (x11)); return clutter_x11_get_stage_window (CLUTTER_STAGE (stage)); } + +void +meta_backend_x11_reload_cursor (MetaBackendX11 *x11) +{ + MetaBackend *backend = META_BACKEND (x11); + MetaCursorRenderer *cursor_renderer = + meta_backend_get_cursor_renderer (backend); + + meta_cursor_renderer_force_update (cursor_renderer); +} diff --git a/src/backends/x11/meta-backend-x11.h b/src/backends/x11/meta-backend-x11.h index cfd5bd7cb..63076f6e4 100644 --- a/src/backends/x11/meta-backend-x11.h +++ b/src/backends/x11/meta-backend-x11.h @@ -57,4 +57,6 @@ void meta_backend_x11_handle_event (MetaBackendX11 *x11, uint8_t meta_backend_x11_get_xkb_event_base (MetaBackendX11 *x11); +void meta_backend_x11_reload_cursor (MetaBackendX11 *x11); + #endif /* META_BACKEND_X11_H */ diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index f5bff0da9..b2510b530 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -1512,6 +1512,7 @@ update_cursor_theme (MetaX11Display *x11_display) Display *xdisplay = meta_backend_x11_get_xdisplay (backend_x11); set_cursor_theme (xdisplay); + meta_backend_x11_reload_cursor (backend_x11); } }