The desktop settings module is shared with X11 and should not walk the
window list and poke at Wayland decoration state. Use a platform hook
like the existing one for cursor theme changes. Also dont recompute
metrics and change window geometry on every title change, only when the
titlebar settings actually change.
Add a touch callback that reports abstract touch events. The design
follows QTouchEvent and NSTouch. A sequence opens with GLFW_TOUCH_BEGIN,
goes on with GLFW_TOUCH_UPDATE and closes with GLFW_TOUCH_END or
GLFW_TOUCH_CANCEL. Each event carries every point that is down on the
window, with its id, its state and its position.
The Wayland backend binds wl_touch and collects the down, motion and up
events until the frame event. It then sends one event to each window
that has a changed point. A point belongs to the window it first
touched, because wl_touch gives its position relative to that surface.
A cancel from the compositor reaches only the windows that were told
that the sequence began. Touches on client-side decorations are not
reported.
glfw does not turn these events into mouse events. That is left to the
application.
Assisted-by: Claude Code:claude-opus-5-5 (mostly)
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>
remap_modifier <from> <to>
Repeatable and off by default. The declarations compose as a single
simultaneous permutation applied once per event, so
remap_modifier ctrl super
remap_modifier super ctrl
exchanges the two rather than collapsing to the identity. Only shift, alt,
ctrl, super, hyper and meta may be named; anything else is rejected with an
error. The last declaration for a given source wins.
The remap is applied to the modifier mask BEFORE the platform produces the
keysym and text - in glfw_xkb_update_modifiers() before xkb_state_update_mask()
on Linux, and in remap_cocoa_flags() before UCKeyTranslate() and
interpretKeyEvents: on macOS. Applying it to the finished event instead
desynchronises the modifiers from the text for any modifier that participates
in text production: shift on Linux, and Option on macOS, which produces text
natively unless macos_option_as_alt is set.
Because the GLFW modifiers are themselves derived from that state, this is
application wide: kitty's own shortcuts, kitty_mod and the bytes sent to the
child all see the remapped modifier, and every mapping in kitty.conf is written
in terms of the modifier a key becomes. X11 pointer events do not go through
xkb, so translateState() - which only ever sees button and DND events - gets
the same treatment; Wayland pointer events already carry xkb-derived modifiers.
A modifier key's own event has its identity remapped too, so a program using
the full keyboard protocol does not see ctrl reported together with LEFT_HYPER.
The press/release state fixup on Linux is given the remapped modifier rather
than the physical one, so press and release agree.
--debug-input reports each remapped event.
Notes: on Wayland kitty only detects hyper and meta when
KITTY_WAYLAND_DETECT_MODIFIERS is set, so remapping to or from them has nothing
to act on there. On macOS hyper and meta have no Cocoa modifier flag, so a
remap onto them is left unapplied rather than silently dropping the modifier,
and interpretKeyEvents: is only approximately corrected because the event's
characters strings were computed by the OS from the physical flags; the
UCKeyTranslate() path, normally the one taken, is exact.
Generated option files and the glfw wrapper come from their generators.
I think I am going to rewrite the API to integrate with the event loop,
now that I have a good handle on the semantics of DnD in the two major
platforms.