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
This commit is contained in:
Kovid Goyal 2024-06-16 15:01:46 +05:30
parent 57aa591a90
commit 2a6870b21f
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 1 deletions

View file

@ -61,6 +61,8 @@ Detailed list of changes
- Wayland: Fix regression in 0.34.0 causing flickering on window resize on NVIDIA drivers (:iss:`7493`)
- Wayland labwc: Fix kitty timing out waiting for compositor to quit fucking around with scales on labwc (:iss:`7540`)
0.35.1 [2024-05-31]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

5
glfw/wl_window.c vendored
View file

@ -549,7 +549,10 @@ fractional_scale_preferred_scale(void *data, struct wp_fractional_scale_v1 *wp_f
debug("Fractional scale requested: %u/120 = %.2f for window %llu\n", scale, scale / 120., window->id);
window->wl.fractional_scale = scale;
// Hyprland sends a fraction scale = 1 event before configuring the xdg surface and then another after with the correct scale
window->wl.window_fully_created = window->wl.once.surface_configured || scale != 120;
// labwc doesnt support preferred buffer scale, so we assume it's done fucking around with scales even if the scale is 120
// As far as I can tell from googling labwc has no way to specify scales other
// than 1 anyway, so no way to test what it will do in such cases. Sigh, more half baked Wayland shit.
window->wl.window_fully_created = window->wl.once.surface_configured || scale != 120 || !_glfw.wl.has_preferred_buffer_scale;
apply_scale_changes(window, true, true);
}