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.
This commit is contained in:
Daniel Eklöf 2020-07-08 19:52:17 +02:00
parent 5539af2597
commit d377221e24
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 17 additions and 9 deletions

View file

@ -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;