From d377221e247f67f7b5e6363f81ae2268e16aa32d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 8 Jul 2020 19:52:17 +0200 Subject: xcursor: trigger theme reload in pointer-enter event Previously, we triggered a theme reload on output changes. This is completely wrong. We may get a new output with a scale different from the output the pointer is actually on. Now, we store the current scale along with the theme. We then trigger a call to reload the xcursor theme *every* time the pointer enters a surface. When it does, we use the current scale factor of the terminal that owns that surface. If the terminal covers multiple outputs, with different scale factors, we'll use the largest scale factor. This may not be 100% correct. But to fix that, we'd need to track which regions of a surface are mapped on which outputs. Too complicated I say. --- input.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'input.c') diff --git a/input.c b/input.c index a035983a..ea344c99 100644 --- a/input.c +++ b/input.c @@ -846,6 +846,9 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer, LOG_DBG("pointer-enter: pointer=%p, serial=%u, surface = %p, new-moused = %p", wl_pointer, serial, surface, term); + /* Scale may have changed */ + wayl_reload_xcursor_theme(seat, term->scale); + seat->mouse_focus = term; int x = wl_fixed_to_int(surface_x) * term->scale; -- cgit v1.3