Commit Graph

214 Commits

Author SHA1 Message Date
Kovid Goyal
9721346387 XWayland: Fix a regression where some wheel mice were not scrolling properly
We assume increment == 1 and delta * 120 == integer means we have
V120 events in units of 1/120.

Fixes #9770
2026-03-29 14:43:48 +05:30
copilot-swe-agent[bot]
6b86e7db5d Extend glfwGetKeyboardRepeatDelay() to return both initial delay and repeat interval
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/bde9bf2e-a0dd-4ccd-8385-6a37be1e025f
2026-03-23 11:58:48 +00:00
copilot-swe-agent[bot]
998ee22ecb Add glfwGetKeyboardRepeatDelay() to the GLFW API for X11, Wayland and Cocoa
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/4765810b-ecf5-4348-ae3a-ff0ff481aaae
2026-03-23 11:46:35 +00:00
copilot-swe-agent[bot]
ef7b456ce7 Fix scroll valuator reset when mouse leaves window without focus change
Fixes #9716
2026-03-20 08:13:45 +05:30
copilot-swe-agent[bot]
36be8be951 Fix massive scroll on focus return by resetting X11 scroll valuators on focus loss
When kitty loses focus and the user scrolls in another
application, X11 XI scroll valuators accumulate position values. When the
user returns to kitty and scrolls, delta (value - v->value) uses the stale
pre-focus-loss value, causing a massive unexpected scroll jump.

Fix: reset scroll valuators (mark them uninitialized) on FocusOut so the
first scroll event after focus is regained sets the baseline without firing
a scroll event.

Fixes #9703
Fixes #9707
2026-03-19 15:31:22 +05:30
copilot-swe-agent[bot]
877be65447 Fix crashes when moving tab between OS windows (issue #9677)
Wayland (glfw/wl_window.c):
- Fix out-of-bounds access in send_drag_data: look up item by MIME type
  instead of using the data-request index i to index _glfw.drag.items[].
  The compositor calls drag_source_send once per target window entered,
  so _glfw.wl.drag.count grows independently of item_count, causing
  _glfw.drag.items[i] to be out-of-bounds on the second drag, yielding a
  garbage optional_data pointer that made write() fail with EFAULT.
- Fix protocol error "Drag has not ended": change on_fail and the
  GLFW_DRAG_DATA_REQUEST error path to call finish_drag_write(i)+return
  instead of cancel_drag(), which was calling wl_data_source_destroy()
  before the compositor ended the drag, violating the Wayland protocol.
- Fix double-free of dr.pending_data: null the pointer after free and
  add cleanup to finish_drag_write().
- Fix missing finish_drag_write() after a full write in data-request
  mode, which left the pipe open causing the target to wait for EOF.

X11 (glfw/x11_window.c):
- Wrap XSendEvent() calls in send_xdnd_enter/position/leave/drop with
  _glfwGrabErrorHandlerX11()/_glfwReleaseErrorHandlerX11(). A target
  window destroyed between discovery and message delivery produced a
  BadWindow error that hit the default X11 abort handler. Now handled
  gracefully by clearing current_target or cancelling the drag."

Fixes #9677
Fixes #9683
2026-03-17 08:53:17 +05:30
Kovid Goyal
c0b549fee8 Make XI2 scroll offset type detection more robust
Since we have to use heuristics, lets at least collect stats for a few
events before deciding.
2026-03-12 21:44:20 +05:30
Kovid Goyal
99639f1373 XInput2: Assume any fractional scroll value means the device is high res
Because as far as I can tell there is no reliable way to detect high res
scroll devices under XWayland. Sigh.
2026-03-12 20:32:15 +05:30
Kovid Goyal
5ba3d10471 X11: Fix a regression that caused some high res scroll devices to be treated as line based scroll devices
Apparently when running under XWayland, we cant rely on libinput to
detect highres scroll devices. Sigh. Linux input is such a disaster.
Dunno if this will break something else, hopefully not.

Fixes #9649
2026-03-12 19:23:41 +05:30
copilot-swe-agent[bot]
4706243380 Fix GLFW drop API to always present full original MIME type list to callbacks
Fixes #9633
2026-03-10 20:10:44 +05:30
Kovid Goyal
7500c58e1c Fix #9569 2026-02-28 16:54:02 +05:30
Kovid Goyal
b737eaad65 Cleanup previous PR
Use a single wl_surface for the drag icon. Whther it is attached to the
top level drag or not is determined based on availability.
2026-02-22 15:36:10 +05:30
Kovid Goyal
531fb3e1b1 Change drag thumbnail when in detach/move modes 2026-02-22 13:09:56 +05:30
copilot-swe-agent[bot]
0c0c5a62f7 Implement changing drag image in the various backends
Fixes #9542
2026-02-22 09:26:14 +05:30
Kovid Goyal
6506ce1e91 API to change image for drag in progress 2026-02-22 09:10:26 +05:30
Kovid Goyal
eb23c18821 Dont detach when user presses esc to cancel drag and there is no drop 2026-02-22 07:42:42 +05:30
copilot-swe-agent[bot]
0dfb01e8c5 Implement X11 drag source backend for the new API
Fixes #9522
2026-02-18 16:55:52 +05:30
Kovid Goyal
a2b7a0cd6d Port Cocoa drag source backend to new API 2026-02-18 11:20:17 +05:30
Kovid Goyal
e5eb63fcd0 Refactor drag source API to be async
Wayland implementation done. Other two backends remain.
2026-02-17 13:07:55 +05:30
Kovid Goyal
34ffc6cdce X11: port drop code to new API 2026-02-09 07:54:40 +05:30
Kovid Goyal
625e3b5d1c Notes for X11 backend refactor 2026-02-08 22:05:14 +05:30
Kovid Goyal
5db41c7ba4 Remove remaining code for the old drop API
X11 and cocoa need to be ported to the new API
2026-02-08 22:05:14 +05:30
Kovid Goyal
3cf24afdc0 Refactor drop API and implement it on Wayland 2026-02-08 22:05:14 +05:30
copilot-swe-agent[bot]
7ca6fd66f8 Fix self drag not working under Wayland
Fixes #9483
2026-02-07 15:10:54 +05:30
Kovid Goyal
07a9f2bcaa API to start a drag 2026-02-07 13:50:16 +05:30
copilot-swe-agent[bot]
5ea35cbbfc Refactor drag API to make it asynchronous
Fixes #9477
2026-02-07 08:59:34 +05:30
Kovid Goyal
9a2ddc887b Cleanup new chunked drop code and use it in kitty
Currently the chunking is useful but it will become useful for a future
drag and drop TUI protocol
2026-02-04 20:34:10 +05:30
copilot-swe-agent[bot]
ed5eb8f45c Allow reading dropped data in chunks
Fixes #9470
2026-02-04 14:18:28 +05:30
copilot-swe-agent[bot]
fac4420804 Simplify new drag/drop API
Fixes #9466
2026-02-03 22:02:51 +05:30
copilot-swe-agent[bot]
9b35c1b535 Allow changing drag acceptance asynchronously
Fixes #9465
2026-02-03 14:43:44 +05:30
copilot-swe-agent[bot]
6744183027 Accept drags based on mime types in drag event callback
Fixes #9456
2026-02-02 21:30:25 +05:30
copilot-swe-agent[bot]
fa6c76d3e3 Add a GLFW API to support starting drag operations
Fixes #9454
Fixes #9455
2026-02-02 20:49:00 +05:30
Kovid Goyal
d0249c1e72 Cleanup X11 momentum-scroll
Dont cancel on the synthetic key events x11 generates for scrolling.
Also use correct timestamp for duration and expiry of physical events.
2026-01-26 12:40:42 +05:30
copilot-swe-agent[bot]
027b73db64 Add momentum scrolling for X11 backend
Fixes #9421
2026-01-26 11:51:57 +05:30
Kovid Goyal
da170555fa Ignore master pointer device events since we use the slave devices 2026-01-11 12:57:56 +05:30
Kovid Goyal
69a25691c5 X11: Fix mouse motion events not being handled
The code to use XI_Motion for scroll events needed to handle motion
events too
2026-01-11 10:44:47 +05:30
copilot-swe-agent[bot]
bfc21fc7a4 X11: handle XI device hotplugging
Fixes #9370
2026-01-10 09:00:37 +05:30
Kovid Goyal
813c560e29 Implement proper scroll event type detection in X11
Uses libinput scroll mode property to detect high res devices.
2026-01-10 08:38:45 +05:30
Kovid Goyal
21da5350d3 Update changelog 2026-01-09 17:22:26 +05:30
copilot-swe-agent[bot]
c1a54a0cc0 Add XI2 smooth scrolling support for X11 backend
Fixes #9369
2026-01-09 17:13:24 +05:30
Kovid Goyal
3c250a741d Wayland: Fix line and v120 scroll event types being multiplied by screen scale
This does not match X11/macOS behavior. And I see no logical reason why
it should be so. The wheel_scroll_multiplier should be used to adjust
this by end users.
2026-01-09 12:50:07 +05:30
Kovid Goyal
ba3af8f2c3 Refactor GLFW scroll event callback to use a proper event struct 2025-12-31 23:40:34 +05:30
alex-huff
1967fd9dd5 panel: implemented --edge=none on X11 2025-10-09 17:18:40 -05:00
Kovid Goyal
982b5156e1 macOS: When toggling in the quick access terminal move it to the currently active screen
Fixes #9003
2025-09-22 20:04:42 +05:30
Kovid Goyal
caba27240b Add some missing assertions
Port from upstream glfw: 38ec7abd3baffdd3ec4e6f8cbb5384cda8882ae3
2025-08-16 07:38:54 +05:30
Kovid Goyal
255dd2845e Implement grab keyboard for x11 2025-05-18 14:49:07 +05:30
Kovid Goyal
6f689f3221 Work on keyboard grabbing functionality 2025-05-18 11:37:11 +05:30
Kovid Goyal
6282a46ff1 A new centered panel type that is sized 2025-05-13 16:38:57 +05:30
Kovid Goyal
9ed6be9272 Quick access terminal: Allow toggling the window to full screen and map using the standard kitty toggle_fullscreen shortcut
Fixes #8626
2025-05-12 15:20:48 +05:30
Kovid Goyal
d22381491d Restore top/bottom panel functionality on i3 2025-05-03 11:12:32 +05:30