Commit Graph

402 Commits

Author SHA1 Message Date
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
Kovid Goyal
caba27240b Add some missing assertions
Port from upstream glfw: 38ec7abd3baffdd3ec4e6f8cbb5384cda8882ae3
2025-08-16 07:38:54 +05:30
Kovid Goyal
8b9d802206 Specify the color space on Wayland surfaces
Uses sRGB with the sRGB transfer function. Seems to give identical
results as not specifying a color space. But sadly does not get the
compositor to blend in linear space, we need another wayland protocol
extension for that I suppose. Sigh.
2025-07-31 19:18:09 +05:30
Kovid Goyal
12c6d799b7 ... 2025-07-31 18:34:29 +05:30
Kovid Goyal
d37bd7afcf Create the sRGB colorspace description we need 2025-07-31 18:30:47 +05:30
Kovid Goyal
46114c251b Create the color manager object for a window surface 2025-07-31 15:24:21 +05:30
Kovid Goyal
7738c55c4b Wayland: Fix incorrect window size calculation when transitioning from fullscreen to non-fullscreen with client side decorations
Fixes #8826
2025-07-17 20:36:38 +05:30
Kovid Goyal
2456574992 Wayland: Only rely on keyboard enter/leave events for OS window focus state
GNOME has broken activated==focused assumption GLFW used to make. Also
follows upstream GLFW behavior. c2f0a0ae59

Fixes #8716
2025-06-09 06:52:56 +05:30
Kovid Goyal
abc9b1fc48 ... 2025-05-18 12:06:10 +05:30
Kovid Goyal
82523b14df Wayland: Dont loose keyboard grab when new OS window created 2025-05-18 11:43:41 +05:30
Kovid Goyal
6f689f3221 Work on keyboard grabbing functionality 2025-05-18 11:37:11 +05:30
Jin Liu
4c6c38929b panel kitten: on Wayland, use app-id for the LayerShellV1 namespace parameter
The Wayland LayerShellV1 protocol doesn't allow setting window class/name/role/type/appId.
Instead, it has a `namespace` parameter that we currently hardcode to `kitty`. It
seems suitable to use app-id for this parameter.

Example use case:
kwin use the `namespace` parameter and an undocumented mapping to set window type for
Layer Shell windows. E.g., "dock" maps to NET:Dock. So if we set `app_id dock` in
quick_access_terminal.conf, the panel would be considered a dock, and won't have the
normal scale in/out animation on shown/hidden.
2025-05-15 23:55:48 +08:00
Kovid Goyal
8017945551 Wayland: Add support for the xdg-toplevel-tag protocol
Now you can use --name or its alias --os-window-tag to set the tag.
2025-05-15 09:35:42 +05:30