fix: window state preservation#2099
Conversation
Drakulix
left a comment
There was a problem hiding this comment.
Thanks! These are very welcome and easy to review bugfixes.
I added some comments, as I would like to see some of the new code to be moved around slightly, if you don't mind.
Drakulix
left a comment
There was a problem hiding this comment.
Thanks! Code-wise this looks great now. Just needs a QA review.
|
@Drakulix There is a small issue with this fix. When I move a maximized window between two workspaces, the destination workspace does not apply the maximized style to the panel and dock, and the source workspace keeps that style instead (opaque/transparent panel and dock). Not sure if that’s very clear… 2026-02-24.19-34-50.mp4 |
|
there is an issue with this pull request, whenever I fullscreen a chromium based browser, then the scrolling stops being smooth and goes back to 60hz, and also when I maximize a chromium based browser or I fullscreen a video and I move the cursor to the top of the monitor to activate the "X" that appears on chromium based browsers to remove the fullscreen, it doesn't always happen and the anymation can be laggy, which doesn't happen on KDE Plasma |
Fixes a bunch of issues where the maximized/snapped state of a window was lost in scenarios involving:
Exact fixes:
For Chromium and similar clients, implements strict protocol compliance via pre-set fullscreen before
unmap.Unmapsends intermediateconfigures considered by Chromium as a refusal to transition to full-screen mode, as they did not contain full-screen. This fixes the issue: [BUG] Maximized chromium browsers: clicking video fullscreen makes browser fullscreen instead #1642 (for both maximized and snapped windows).Preserving snapped state when transitioning to fullscreen/minimizing.
FloatingRestoreDatanow storeswas_snapped: Option<TiledCorners>. The information is captured beforefloating_layer.unmap()clears it and is used later for restoration.Preserving maximized/snapped state when moving between workspaces. After moving the window, the maximized or snapped state from
FloatingRestoreDatais re-applied in the target workspace (Maximized windows don't stay maximized when they are moved to a different display or workspace #528, Maximized window loses its state when moved to another workspace cosmic-epoch#2608)What I tested:
I tried to make the changes as small as possible.
I also wanted to fix the issue with returning the window to the stack from full-screen state in this PR, but it appears to be much more complicated than I initially imagined and has a lot of edge cases.