Skip to content

[DRAFT] Introduced forced CSD mode#20915

Draft
kekekeks wants to merge 2 commits intomasterfrom
feature/forced-csd
Draft

[DRAFT] Introduced forced CSD mode#20915
kekekeks wants to merge 2 commits intomasterfrom
feature/forced-csd

Conversation

@kekekeks
Copy link
Member

@kekekeks kekekeks commented Mar 16, 2026

Introduce a mode where drawn decorations are forced by the platform backend regardless of the extend-client-area-to-decorations hint from the user code.

Note that the implementation contains a hack required to prevent invalid window dimensions when restoring from maximized/fullscreen mode - ArrangeSetBounds is moved to TopLevelHost in that case.

The hack is needed for the following scenario:

  1. window state goes from maximized to normal
  2. the set of enabled decorations gets changed (i. e. we now need border/shadow)
  3. TopLevelHost's measure gets invalidated
  4. Layout pass is triggered
  5. Layout pass is executed before actual resize from X11 because of X11 being async and stuff
  6. Everything is measured with the old ClientSize
  7. Arrange happens

The hack moves PlatformImpl.Resize to TopLevelHost and it is skipped on arrange if size is unchanged. Since Window's own measure is somehow still valid at this point (no resize event happened, I suppose) it somehow still works. I've tried moving this check to Window, but layout cycle would mess up the sizing.

The hack is disabled for existing platforms since they don't have forced decorations mode yet.

@MrJul I don't think we should be merging this for RC1, right now the PR is here for me to base wayland branch on (it needs this mode).

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.

1 participant