Skip to content

Center position new windows with offset considering panel and dock y-heights #2560

@vjr

Description

@vjr

Problem

New windows are currently centered by Mutter (I believe) which positions them based only on screen dimensions and window size but this does not consider the y-height of the dock or panel resulting in a skewed appearance to the positioning, meaning the window appears to be placed closer to the dock and farther from the panel, triggering my OCD and making me want to address this in a PR.

Proposal

Adjust the y-offset of new windows to "exclude" the y-heights of the dock and panel so that they are placed slightly higher up when being positioned so they appear (better?) centered.

I'd earlier worked on a diff in WindowStateSaver that did this but was advised by a core dev (lenemter or leonhard IIRC) that we should probably leave this alone and let Mutter do its thing. I'd like to revisit this proposal for a wider review for advice and am asking for anyone to point me to a more elegant way to do this than in WindowStateSaver like I might have seen potential ideas to intercept/override Mutter APIs (in Meta.Plugin maybe?) so I can apply the offset in a clean way.

This diff would be relevant for the future too if there's a GNOME-like option added (or is there one already?) to "always center new windows" (overriding the WindowStateSaver) with a keyboard shortcut.

See the following "before" and "after" screenshots aka "current" and "proposed" pics, manually positioned for effect, that illustrate this issue, with apologies if they're oversized:

CURRENT:

Image

PROPOSED:

Image

Prior Art (Optional)

No response

Metadata

Metadata

Assignees

Labels

Needs DesignWaiting for input from the UX team

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions