Commit graph

310 commits

Author SHA1 Message Date
Kovid Goyal
3e8abaac58
... 2024-08-27 10:30:35 +05:30
Kovid Goyal
68401eddba
Wayland: Don't do two stage window creation
We cant make window visible after createwindow has returned because we
want to loop till the compositor fully creates the window and that loop
requires attaching a single pixel buffer to the window surface which
cannot be done once an OpenGL context is created for the window.

As far as I can see the preshow callback is not used on Wayland for
anything, so this should be OK to do.
2024-08-27 10:25:18 +05:30
Kovid Goyal
0594033b31
Wayland: Move creation of OpenGL context to end of window creation function
Apparently with explicit sync it is now not possible to attach a
temporary buffer to a surface that also has an OpenGL context. So we
first attach the temporary buffer, and only after we are done waiting
for window creation do we attach the OpenGL context to the window
surface.

Fixes #7767 (maybe, not installing sway-git to check)
2024-08-26 15:36:27 +05:30
Kovid Goyal
c18098d872
Cleanup DBUS send notification API 2024-07-26 23:57:36 +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
48f053b8cc
Fix #7555 2024-06-18 05:59:12 +05:30
Adam Schmalhofer
8fabc47776 Fix Gnome 44 invisible title bar on Wayland
a.k.a. title bar is completely missing

Fixes: https://github.com/kovidgoyal/kitty/issues/7425
2024-06-17 13:18:48 +02:00
Kovid Goyal
2a6870b21f
Wayland labwc: Fix kitty timing out waiting for compositor to quit fucking around with scales on labwc
labwc is unique among Wayland compositors in implementing fractional
scale but not preferred integer buffer scale events. We didn't cater to
this particular combination of before. And to top it off it appears to
have no way for the user to set/control the scale so I cant even test
what it will do with fractional scales other than 1. Sigh. As with all
things Wayland, you need to be a masochist to subject yourself to them.

Fixes #7540
2024-06-16 15:01:46 +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
55417e4269
Move the window context changing during show fix into glfw code
It more logically belongs there.
2024-05-28 09:46:16 +05:30
Kovid Goyal
32f3d43aa0
Support setting urgency for DBUS notifications 2024-05-16 20:10:26 +05:30
Kovid Goyal
65f06e8fdb
Wayland: Fix crash on compositors that dont support the window activation protocol 2024-05-06 08:52:01 +05:30
Kovid Goyal
ce4237c45d
DRYer 2024-05-05 14:09:18 +05:30
Kovid Goyal
849dcd424d
Wayland: save energy by not rendering "suspended" windows on compositors that support that
Note that this breaks kitty on GNOME 45 which has a bug, but it fine on
GNOME 46.
2024-05-05 13:42:51 +05:30
Kovid Goyal
8c7994c0ac
Dont call wl_egl_window_resize on every swap 2024-04-24 10:04:06 +05:30
Kovid Goyal
8e59b598e0
Improve logging slightly 2024-04-24 09:38:59 +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
0f00b0cfb6
Use RAII for context management 2024-04-24 08:21:27 +05:30
Kovid Goyal
9755d0d879
Wayland: Ensure context is correct when calling wl_egl_window_resize
Fixes #7373 (I hope)
2024-04-22 18:07:34 +05:30
Kovid Goyal
fbefd8600f
output window id is debug logs useful for debugging issues with multiple os windows 2024-04-22 14:04:26 +05:30
Kovid Goyal
8d1b0e54af
Use double for wayland float calculation 2024-04-19 22:23:01 +05:30
Kovid Goyal
494892c7e4
Dont create the region unless actually needed 2024-04-16 18:16:28 +05:30
Kovid Goyal
6c1a83ffd7
Wayland KDE: Fix window background blur not adapting when window is grown. Also fix turning it on and off not working.
Fixes #7351
2024-04-16 18:11:26 +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
eb96830aa0
Make CSD API functions naming consistent 2024-04-07 10:18:13 +05:30
Kovid Goyal
283eba9667
Wayland: Respect top level bounds sent by compositor 2024-04-06 17:29:17 +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
d4cc5aa698
Report errors when attempts are made to perform actions the compositor doesnt support 2024-04-06 11:09:22 +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
9225bd772d
Reduce CSD API surface 2024-04-05 19:57:43 +05:30
Kovid Goyal
9e55951d5a
... 2024-04-05 19:37:41 +05:30
Kovid Goyal
d9663aa135
Make code a little clearer 2024-04-05 19:29:51 +05:30
Kovid Goyal
9d86448585
Wayland: Allow hiding window decorations on compositors with SSD as well 2024-04-05 19:23:42 +05:30
Kovid Goyal
1bffe89b5d
Wayland GNOME: titlebar color now follows system theme
When GNOME system theme is default, the color matches the background
color. When it is dark it is dark.
2024-04-04 21:52:56 +05:30
Kovid Goyal
bdfa57039c
Get rid of frame dependent size storage in kitty layer
This unifies behaviour with CSD and SSD. Now, in both cases the
remembered size is the size of the content area.
2024-04-04 19:39:02 +05:30
Kovid Goyal
f51c2f08a5
DRYer 2024-04-04 19:11:21 +05:30
Kovid Goyal
76999d1a67
Fix creation of single pixel buffer to use 32 bits per color channel 2024-04-04 16:13:28 +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
aca13a619a
Retry all the ssh kitten tests on failure once 2024-03-26 19:45:20 +05:30
Kovid Goyal
dd879c413a
Initialize temp wayland buffer with background color 2024-03-26 19:31:27 +05:30
Kovid Goyal
351e96ca75
Ensure temp buffer is destroyed once normal swapping is in place 2024-03-26 17:13:31 +05:30
Kovid Goyal
610390ed69
abort ready loop if window receives a close event 2024-03-26 15:44:02 +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
073f78badb
... 2024-03-26 14:09:19 +05:30
Kovid Goyal
0c5e8be49a
... 2024-03-26 14:06:39 +05:30
Kovid Goyal
f7a7765ba2
Clean up debug rendering output 2024-03-26 13:06:08 +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