Skip to content

wayland: Handle min/max sizes in fixed-size windows with viewports#14039

Merged
Kontrabant merged 1 commit into
libsdl-org:mainfrom
Kontrabant:wayland_libdecor_order
Feb 28, 2026
Merged

wayland: Handle min/max sizes in fixed-size windows with viewports#14039
Kontrabant merged 1 commit into
libsdl-org:mainfrom
Kontrabant:wayland_libdecor_order

Conversation

@Kontrabant

@Kontrabant Kontrabant commented Sep 24, 2025

Copy link
Copy Markdown
Contributor

The associated surface commit causes a warning (previously a crash) on GNOME + libdecor when clients enter fullscreen before the initial buffer commit.

This was only ever needed on GNOME, and is fixed in GNOME 49, but is waiting on upstream backports: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4681 and https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4680

This also cleans up some additional edge-case window handling cases and fixes the issue where Wayland is sometimes at-odds with clients that want to enforce an aspect ratio or min/max window size, as certain window states have dimensions that either must be obeyed (maximized), or will give terrible results if they aren't (tiled). Viewports and a masking subsurface are used to handle cases where surfaces are unable to match the exact window size. The behavior of windows with a min/max limit is much nicer on tiling compositors in particular.

Fixes #14032

@Kontrabant Kontrabant added this to the 3.x milestone Sep 24, 2025
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch 2 times, most recently from e1df180 to 940d919 Compare September 24, 2025 18:44
@slouken

slouken commented Oct 12, 2025

Copy link
Copy Markdown
Collaborator

Should this go in for 3.4?

@Kontrabant

Copy link
Copy Markdown
Contributor Author

It can't go in before the backported GNOME fixes are merged, or things will break for users on older versions.

@Kontrabant

Copy link
Copy Markdown
Contributor Author

Just to note, the upstream changes are merged, and should ship in 48.7 later in November.

@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch 2 times, most recently from 3f84db6 to 683041d Compare November 19, 2025 16:55
@Kontrabant Kontrabant modified the milestones: 3.x, 3.6.0 Dec 2, 2025
@Kontrabant

Copy link
Copy Markdown
Contributor Author

Tagging this to go in early in the 3.6 cycle. The changes are upstream in GNOME, but they still need time to propagate and be backported where required, and I have some other windowing work that stacked nicely on top of this, regarding how windows with a min/max size and aspect are handled when the compositor demands that the window be a certain size, such as with maximized or tiled windows.

@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch from 683041d to feb5728 Compare December 3, 2025 19:42
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch 5 times, most recently from 780f96d to 7b44d01 Compare January 20, 2026 20:07
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch from 7b44d01 to e924f9d Compare February 7, 2026 20:55
@Kontrabant Kontrabant changed the title wayland: Remove the hack to unset limits before entering fullscreen wayland: Handle min/max sizes in fixed-size windows with viewports Feb 7, 2026
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch from e924f9d to ba83f0c Compare February 7, 2026 21:38
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch 4 times, most recently from fecebf2 to 2af0c6b Compare February 22, 2026 18:17
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch 2 times, most recently from 5cfec26 to 4051e8b Compare February 25, 2026 17:55
@Kontrabant
Kontrabant marked this pull request as ready for review February 25, 2026 18:14
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch 2 times, most recently from 0ebb1e3 to 590056a Compare February 26, 2026 17:25
@Kontrabant

Copy link
Copy Markdown
Contributor Author

GNOME has backported and pushed the requires fixes some time ago, I've been running this locally for a couple of months while refining it, and it seems to be ready and regression free at this point. Going to look this over one last time over the weekend, and it should be good for wider testing in 3.6.

@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch from 590056a to 66eb9e7 Compare February 28, 2026 16:51
Wayland is sometimes at-odds with clients that want to enforce an aspect ratio or min/max window size, as certain window states have dimensions that either must be obeyed (maximized), or will give terrible results if they aren't (tiled). Use a viewport and a masking subsurface to handle cases where surfaces are unable to match the exact window size.

The changes made to accommodate this also catches some additional windowing related edge-cases, simplifies synchronization, and prevents commits before a buffer has been attached to the surface.
@Kontrabant
Kontrabant force-pushed the wayland_libdecor_order branch from 66eb9e7 to 03e3149 Compare February 28, 2026 16:58
@Kontrabant

Copy link
Copy Markdown
Contributor Author

One last little cleanup, the build passes, and this should be good to go.

@Kontrabant
Kontrabant merged commit 0a45525 into libsdl-org:main Feb 28, 2026
45 checks passed
@Kontrabant
Kontrabant deleted the wayland_libdecor_order branch February 28, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wayland: Full screen ioquake3 window reports size to compositor as 0x0 pixels

2 participants