Commit Graph

132 Commits

Author SHA1 Message Date
Kovid Goyal
c1b6b4494a Implement starting kitty hidden
Fixes #3466
2025-04-23 08:50:02 +05:30
Kovid Goyal
5d2e258c35 Wayland: When the compositor supports the xdg-system-bell protocol use it to play the default bell sound 2025-04-16 15:48:51 +05:30
Kovid Goyal
49092f5a94 Add new wayland top level state enum values 2025-04-09 19:23:27 +05:30
Kovid Goyal
3b8e0e209b Wayland: Allow overriding the kitty OS Window icon on compositors that implement the xdg-toplevel-icon protocol 2025-03-10 12:32:03 +05:30
Kovid Goyal
0c47f81187 Remove special casing for Hyprland
Hyprland has now been fixed to send only a single fractional scale
event, so no need for special casing it.
2025-01-22 18:53:46 +05:30
Kovid Goyal
0527db876b Wayland niri: Fix 250ms delay on startup when using scale 1
We special case Hyprland, hopefully the special casing can be removed
once https://github.com/hyprwm/Hyprland/issues/9126 is fixed.

Fixes #8236
2025-01-21 16:40:32 +05:30
Kovid Goyal
7346aca56d Function to probe for Wayland compositor name
Maybe needed to workaround #8236
2025-01-21 15:10:07 +05:30
Kovid Goyal
1ff74b86dc Wayland GNOME: Workaround bug in mutter causing double tap on titlebar to not always work
Fixes #8054
2024-11-18 08:46:17 +05:30
Kovid Goyal
627360e5ad Bind the idle inhibit protocol even though it is currently unused 2024-08-27 11:32:06 +05:30
Kovid Goyal
d7902f6b24 Wayland GNOME: Fix a small rendering artifact when docking a window at a screen edge or maximizing it
For some reason destroying the shadow surfaces causes mutter to render one of them at its old relative position. So workaround by not destroying the surfaces, modern mutter anyway seems to hide them when the window is docked.

Fixes #7701
2024-08-07 13:34:10 +05:30
Kovid Goyal
190566be8e Wayland: Fix specifying the output name for the panel kitten not working
Fixes #7573
2024-06-25 12:53:37 +05:30
Kovid Goyal
88aa4d1de3 Revert 72272ab4fe
Apparently NVIDIA drivers dont handle this well. Sigh.

Go back to calling wl_egl_window_resize() before resizing the
framebuffer instead of before swapping in the resized framebuffer.
Logically, these should be equivalent, but...

Wayland is such an ongoing disaster.

Fixes #7493 (I hope).
2024-06-02 19:24:00 +05:30
Kovid Goyal
8c7994c0ac Dont call wl_egl_window_resize on every swap 2024-04-24 10:04:06 +05:30
Kovid Goyal
72272ab4fe Remove need for context switching
Call wl_egl_window_resize just buffer swapping buffers at which point
the context is already correct.

Also might workaround bugs in the NVIDIA driver: https://github.com/NVIDIA/egl-wayland/issues/52
2024-04-24 09:27:02 +05:30
Kovid Goyal
8d1b0e54af Use double for wayland float calculation 2024-04-19 22:23:01 +05:30
Kovid Goyal
ac4eef7eb3 Another try at pointer frame support on Wayland
This time I think I got the wheel handling correct. At least works with
my wheel mouse.
2024-04-08 19:07:52 +05:30
Kovid Goyal
8fc96c5bd7 Make the debug logging functions consistent
They now all output the same format of:
[time since program start] msg
2024-04-08 12:53:55 +05:30
Kovid Goyal
d392aba64d Wayland CSD: Dont render window shadows for docked windows 2024-04-08 10:59:03 +05:30
Kovid Goyal
d630b3d8a7 Change the maximize icon to restore when window is maximized 2024-04-08 09:36:38 +05:30
Kovid Goyal
bf60321466 Use individual surfaces for corner and bar shadows
Simplifies a bunch of code and also gives us the option at a later date
to turn off some shadows selectively when the window is in a tiled
state.
2024-04-07 22:28:41 +05:30
Kovid Goyal
5b1fdc34eb Wire up the buttons 2024-04-06 14:58:31 +05:30
Kovid Goyal
60cb0fa650 Move CSD pointer handling code into CSD file 2024-04-06 12:49:07 +05:30
Kovid Goyal
235b8dc2e4 Assume all capabilities on compositors that dont support reporting of capabilities 2024-04-06 10:59:28 +05:30
Kovid Goyal
4f6faddbab Implement rendering of window control buttons in CSD
They still need to be wired up
2024-04-06 08:32:07 +05:30
Kovid Goyal
f51c2f08a5 DRYer 2024-04-04 19:11:21 +05:30
Kovid Goyal
b3197e4498 Wayland: Add fractional scale support to CSD 2024-04-04 11:25:17 +05:30
Kovid Goyal
b4bba99678 Use single pixel buffer protocol for more efficient temp buffer creation 2024-04-04 09:00:33 +05:30
Kovid Goyal
5a62bbdd33 Revert "Wayland: Add support for pointer frame events. Code taken with thanks from SDL"
This reverts commit 506be129e1.
Seems to have broken wheel scrolling and I lake the time/interest to
debug why. Since this commit didnt actually solve any real issue revert
it for now. Revisit in the future when I have more bandwidth.

Fix #7287
2024-03-31 20:33:58 +05:30
Kovid Goyal
506be129e1 Wayland: Add support for pointer frame events. Code taken with thanks from SDL 2024-03-28 15:32:59 +05:30
Kovid Goyal
a40a36d191 Wayland: Remove the 120ms penalty from waiting for window creation
When showing the window we loop in the wayland backend using a
temporary buffer of blank pixels to force the compositor to finish
setting up the top level surface pronto.

TODO: Set the color of the temmporary buffer to the background color
2024-03-26 15:40:13 +05:30
Kovid Goyal
adf5917325 Wayland: Only launch child after OS Window achieves its final size
Avoids a bunch of SIGIWNCH during child startup as not all programs
handle these correctly. Sadly adds about 0.1 seconds of latency to
startup. Will have to look into reducing that. The Wayland protocol is
*so badly* designed.
2024-03-26 12:48:45 +05:30
Kovid Goyal
2edd332759 Flag to indicate that we expect scale from compositor 2024-03-26 10:41:40 +05:30
Kovid Goyal
fe5ccc144b Finish glfw side support for layer shell 2024-03-24 20:48:20 +05:30
Kovid Goyal
707e69a794 Start work on wayland layer shell support 2024-03-24 20:48:20 +05:30
Kovid Goyal
1c9f9a74e8 Wayland KDE: Add support for background_blur under kwin using a kwin private Wayland protocol 2024-03-22 13:41:44 +05:30
Kovid Goyal
83468535dd Implement support for preferred buffer scale 2024-03-21 20:53:36 +05:30
Kovid Goyal
55115058d2 Scale pointer axis events by effective scale 2024-03-21 20:53:36 +05:30
Kovid Goyal
776bfa3d7e Basic fractional scale protocol works 2024-03-21 20:53:36 +05:30
Kovid Goyal
6979f1c5eb Add listener for fractional scale events 2024-03-21 20:53:36 +05:30
Kovid Goyal
5d0c25f5ea Register the viewporter 2024-03-21 20:53:36 +05:30
Kovid Goyal
eb42ad3a2b Rename scale to integer_scale
We will presumably have a fractional_scale soon
2024-03-21 20:53:36 +05:30
Kovid Goyal
2b6edbccbc Start work on fractional scale support for Wayland
Register the interface on startup
2024-03-21 20:53:36 +05:30
Kovid Goyal
3c4db20d2d DRYer 2024-03-21 11:27:41 +05:30
Jin Liu
e20eff277b Fix Wayland cursor-shape-v1 cursor not updating
According to https://wayland.app/protocols/cursor-shape-v1#wp_cursor_shape_device_v1:request:set_shape
> The serial parameter must match the latest wl_pointer.enter or
> zwp_tablet_tool_v2.proximity_in serial number sent to the client.

So we can't use wl.serial or wl.pointer_serial, because they are also updated in other places.
2024-01-04 19:54:03 +08:00
Kovid Goyal
cff490f881 Wayland: Add support for the new cursor-shape protocol
It is currently disabled because no compositor seems to support it.
Hyprland reports it as available but using it causes Hyprland to crash.
Plasma 6 is supposed to have it but I am not installing a beta just for
this.

Typical Wayland.
2023-12-24 18:45:17 +05:30
Kovid Goyal
61429c73c7 Wayland: Fix primary selections not working with the river compositor
Fixes #6785
2023-11-03 19:57:54 +05:30
Kovid Goyal
f63bbfc88c Wayland: Do not request idle inhibition for full screen windows
Fixes #6613
2023-09-12 16:43:46 +05:30
Kovid Goyal
95d15648fa Fix not building with wayland-protocols 1.32
Fix #6422
2023-07-05 10:33:56 +05:30
Kovid Goyal
2435a8ccfd Wayland GNOME: Fix incorrect window size when in some circumstances when switching between windows with window decorations disabled
Only call wl_surface_commit() after a resize when the correct size buffer is
attached to the surface. This is ensured by setting a flag on the window that prevents
all surface commits till it is cleared. The flag is cleared at next
eglSwapBuffers().

I dont actually understand if this guarantees that the
buffer size is always correct. For example, if the back buffer is
latched when wl_egl_resize_window() is called, the backbuffer will be
correct only after two swaps (I think). Or maybe the old back buffer is
discarded, I cant find any documentation about it.

All I can say is that doing it this way seems to fix the issue.

Thanks to @jadahl for his help with tracking down the root cause.

Fixes #4802
2022-10-31 21:59:01 +05:30
Kovid Goyal
6890e265b6 GNOME Wayland: Fix a memory leak in gnome-shell when using client side decorations
destroy CSD buffers that were never attached explicitly, as mutter does
not send release events for these even when the pool is destroyed.
2022-10-12 17:52:47 +05:30