Commit Graph

414 Commits

Author SHA1 Message Date
Kovid Goyal
1c4097edde Remove unnecessary event pump when attaching top level drag surface 2026-04-07 17:25:18 +05:30
Kovid Goyal
837f55fe21 ... 2026-04-07 13:47:47 +05:30
copilot-swe-agent[bot]
a90b8470ac Fix drag icon not visible under GNOME Wayland
Fixes #9823
2026-04-07 13:31:04 +05:30
Kovid Goyal
cd3860817b ... 2026-04-07 11:47:58 +05:30
Kovid Goyal
9fbb079ad6 Add logging for DnD events on Wayland 2026-04-07 11:32:12 +05:30
Kovid Goyal
dc55052f0c Wayland: set drop accepted operations 2026-04-07 10:40:14 +05:30
copilot-swe-agent[bot]
2f33460864 Add operations==-3 cancel drag support to glfwStartDrag
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/eff7e2c8-ab7a-4967-95b5-e65631245701

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-02 07:14:36 +00:00
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]
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
ddfd8d7f45 Wayland: Dont set window icons on layer shell windows as some compositors complain about them 2026-03-16 08:28:36 +05:30
Kovid Goyal
e72f49952d Linux: Fix regression that broke drag and drop from GTK applications
Fixes #9656
2026-03-13 20:19:33 +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
5cc510dea4 Merge branch 'titlebar-only-wayland' of https://github.com/antoinecellerier/kitty 2026-02-23 19:19:30 +05:30
Kovid Goyal
9f2a4ad2dd Wayland: Implement ridiculous workaround for broken dnd
Wayland is *the worst* window system I have ever had the
displeasure of trying to support.
2026-02-22 16:24:46 +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
copilot-swe-agent[bot]
accee908aa Implement Wayland xdg-toplevel-drag protocol for make_toplevel in _glfwPlatformChangeDragImage
Fixes #9544
2026-02-22 14:53:34 +05:30
Kovid Goyal
531fb3e1b1 Change drag thumbnail when in detach/move modes 2026-02-22 13:09:56 +05:30
Kovid Goyal
449abb69bc Cleanup previous PR 2026-02-22 11:13:57 +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
8ad22e7859 On Wayland detach even on drag cancel
Wayland compositors contravene their own spec and make it impossible to
distinguish between drop-but-not-accept and drag-cancel cases.
https://gitlab.freedesktop.org/wayland/wayland/-/issues/140
2026-02-22 08:19:31 +05:30
copilot-swe-agent[bot]
bcba8fc04c Wayland: Add support for ext-background-effects
Fixes #9536
Fixes #9534
2026-02-21 20:56:40 +05:30
Kovid Goyal
96c01b74d8 Detach tab via drag and drop now implemented 2026-02-21 15:15:33 +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
a99103d9a1 Drop events should use same co-ordinate system as mouse events 2026-02-13 10:08:25 +05:30
Antoine Cellerier
ef4574ae97 Support hide_window_decorations titlebar-only on Wayland
Hide the CSD titlebar subsurface while keeping shadow borders for
resizing. On SSD compositors (GNOME), forces CSD mode to draw
kitty's own shadows without a titlebar.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-08 19:49:44 +01:00
Kovid Goyal
08217c949d Fix crash on self drop 2026-02-08 22:05:15 +05:30
Kovid Goyal
af4f3969b7 remove watch after all data is received on pipe 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
f3cda7e828 Have mimes_count be always accurate 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
d51dec8187 When dropping, paste into window under mouse cursor rather than active window 2026-02-04 21:21:25 +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
9ef934cf54 Wayland: Remove usage of the Wayland color management protocol to inform compositors of the color space used by kitty
As is typical with Wayland, the protocol is poorly designed and
implemented even worse. Hyprland 0.53 has completely broken color
management.
https://github.com/hyprwm/Hyprland/discussions/12788
In addition it and mangowc crash when using color management with nouveau drivers.
https://github.com/kovidgoyal/kitty/issues/9030

KDE kwin does not support the sRGB transfer function. And the geniuses
at Wayland are any way planning to deprecate sRGB as a transfer function.

Only GNOME mutter seems to get it right.

Then there are people that are likely going to shoehorn this into EGL
instead of leaving it under application control via the protocol anyway.
https://github.com/KhronosGroup/EGL-Registry/issues/197

Sigh. Wayland.
2026-01-15 09:53:09 +05:30
Kovid Goyal
06e7f5ec37 Fix #9306 2025-12-20 08:54:22 +05:30
Kovid Goyal
16008b950a Wayland: Fix spurious key repeat events when some user defined callback takes a long time to execute
On compositors that support compositor key repeat events, use those, for
complete robustness. Sadly no actual compositor implements these yet.

Otherwise use a timer fd/pipe to queue the repeat events and only
dispatch them after events from the compositor are handled. This means
release events from the compositor will prevent spurious repeat events.
One can, in the worst case lose some repeat events if there is a very
large interval between the start of the timer and the next poll, but
that is unavoidable and is why repeat events should come from the compositor
in the first place.

Fixes #9224
2025-12-03 22:26:09 +05:30
alex-huff
10e0d11093 panel: use an anchor of 0 for --edge=center-sized
Fixes #9116
2025-10-16 10:04:55 -05:00
Kovid Goyal
bdae74d7ed Wayland: Ensure color manager get_surface is called just once
This should not be needed since create_surface is called just once, but
good to be safe.
2025-09-29 08:36:51 +05:30
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
148d60b9ea Make CodeQL happy 2025-09-16 07:57:33 +05:30