Skip to content

Constrain restored window size to monitor work area - #1104

Closed
rafaumeu wants to merge 1 commit into
linuxmint:masterfrom
rafaumeu:fix/window-bounds-workarea
Closed

rafaumeu wants to merge 1 commit into
linuxmint:masterfrom
rafaumeu:fix/window-bounds-workarea

Conversation

@rafaumeu

Copy link
Copy Markdown

Fixes #1057.

Saved window dimensions can exceed the current monitor work area after a display configuration change, or be invalid.

Restore the saved size within the window monitor work area, with a valid lower bound, falling back to the saved dimensions when monitor detection is unavailable.

Tested with python3 -m py_compile usr/lib/linuxmint/mintUpdate/mintUpdate.py, git diff --check, and a local GTK/Gdk work-area bounds harness. ./test was not run because it modifies /usr.

AI-assisted research and draft; independently reviewed and tested locally.

@rafaumeu
rafaumeu force-pushed the fix/window-bounds-workarea branch from 2b0a2cc to 438ac62 Compare October 26, 2026 13:49
mtwebster added a commit to linuxmint/muffin that referenced this pull request Nov 4, 2026
windows.

This should apply to all decorated windows. The existing exceptions
predated client-side decorations - Wayland sessions don't support
server-decorations yet, so this was being skipped initially for all
windows there.

ref: linuxmint/mintupdate#1104
mtwebster added a commit that referenced this pull request Nov 4, 2026
@mtwebster

Copy link
Copy Markdown
Member

This is overkill here I think - looking at the original bug report, it looks like the window was maximized originally before closing, then closed, which saved that size.

I think to avoid this in the first place we should just skip saving when maximized. If we'd like to actually track that in the future we can add a setting to save that "state" rather than matching monitor sizes, which is not reliable in multiple monitor setups, especially before the window has been mapped to a monitor.

ref:
2b1bd03
linuxmint/muffin@d52ab46 (Additional fix for Wayland sessions)

@mtwebster mtwebster closed this Nov 4, 2026
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.

Window fills the entire screen but isn't maximized

2 participants