mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-21 01:40:16 -05:00
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:
parent
5539af2597
commit
d377221e24
3 changed files with 17 additions and 9 deletions
3
input.c
3
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue