Skip to content

Conversation

mstv
Copy link
Member

@mstv mstv commented Jan 2, 2025

Fixes #11589 for maximized FormCommit

Proposed changes

WindowPositionManager:

  • Add vertical heuristic analogue to existing horizontal heuristic
  • Default to top left of first screen as fallback

Screenshots

N/A

Test methodology

  • manual
  • adapt existing tests

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@mstv mstv self-assigned this Jan 2, 2025
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot repro: Tried swiching of the second monitor, deactivating but the check always fulfills Debug.WriteLine($"{screen.ToString()} contains {p} (R, T)");
But the change seem OK to me

@mstv
Copy link
Member Author

mstv commented Jan 2, 2025

I moved FormCommit to the secondary screen (4K with scaling of 150%) at the right of the primary screen (2K 100%) and maximized it. Close and re-open restored the maximized state but on the primary screen.

@RussKie
Copy link
Member

RussKie commented Jan 3, 2025

The core underlying issue only surfaces when monitors run at different dpi. Because the app is run as "system aware", it's unable to scale windows correctly opened on the second monitor (being primary or secondary). The new windows are being opened with the dpi of the monitor where the parent window resides.

@mstv mstv merged commit 6e34269 into gitextensions:master Jan 3, 2025
3 of 4 checks passed
@mstv mstv deleted the fix/11589_restore_window_position branch January 3, 2025 18:38
@mstv mstv added this to the v5.2 milestone Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GE Unresponsive after clicking Commit (on Laptop screen only!)
3 participants