resetScrollValuators() runs on every LeaveNotify, clearing the initialized
flag of every scroll valuator. handle_xi_motion_event() then treats the next
XI_Motion event as a baseline sample and discards it.
On setups where the X server emits crossing events with mode NotifyGrab
faster than the wheel is turned, every scroll event lands in that branch and
is swallowed, so scrolling does not work at all. This is easy to hit inside a
VMware guest, where the same physical mouse is exposed as several pointer
devices: --debug-input shows a continuous leave/enter cycle and a single
Scroll event for the whole session.
Fix this in two places:
- Do not reset the baseline for crossing events generated by a grab being
activated/released or by the pointer moving to a child window, since the
pointer did not actually leave.
- Keep the baseline value across a reset so the next event can still compute
a delta from it, and only discard the event when the jump is too large to
be a genuine scroll.
Fixes#9846
On X11 glfw_xkb_compile_keymap() gets its state from
xkb_x11_state_new_from_device(), which seeds it with the server's physical
modifier mask. Every other path into that state goes through
glfw_xkb_update_modifiers(), where the permutation is applied, so after a
keymap reload the state held physical modifiers until the next XkbStateNotify
happened to arrive. Any key pressed in that window was encoded with the
modifier on the keycap: with ctrl held across a reload under
`remap_modifiers ctrl:super`, Ctrl+A reached the child as a literal 0x01.
Keymap reloads are routine - switching layout causes one, and so does any
client asking X for a keysym it must bind to a spare keycode.
Re-apply the permutation to the freshly loaded state, after
glfw_xkb_update_masks() has computed the modifier indices it is expressed in.
On Wayland the new state is empty, so this is a no-op there.
Adds remap_modifier config option to present one modifier key to kitty
as another, as discussed in issue #1077. Resolves merge conflicts by
adopting master's formatting style (multi-line macros, pointer spacing)
while preserving all new PR functionality.
Co-Authored-By: Bjoern <bjohas@users.noreply.github.com>