aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-08 17:52:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-08 17:52:17 +0000
commitd377221e247f67f7b5e6363f81ae2268e16aa32d (patch)
treeffb13a52c379fd8b511a1928c5fe581b6b66d176 /input.c
parentwayland: seat: log keyboard/pointer capability (diff)
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.
Diffstat (limited to 'input.c')
-rw-r--r--input.c3
1 files changed, 3 insertions, 0 deletions
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;