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
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).
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
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
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
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.
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.
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
Much like toplevel configures, xdg decoration configures only take
effect once the xdg shell configure comes through. Also,
let's get rid of some double computations because we unified the code
paths.
This will let us add more stuff later. Also, it's a better spot
to put the bit field outside of the {current, pending} struct as
the bit field doesn't make any sense if it's part of the `current`
values.