-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure windows are visible when recovering a session #2007
Conversation
@papr @pfaion The implementation currently in this PR tests if the origin of the window is within any of the connected monitors. This, however, can lead to situations where even windows with as little as 1 pixel (origin) within the monitor keep their position. I was thinking about an alternative implementation where we would calculate an intersection rectangle of the window and each monitor. The rectangle would be valid if it's at least |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea about the intersection area. But since windows are only movable if their "header" is clickable, I suggest applying your logic such that the header has a minimum visible area before resetting the window to its default position.
The new implementation checks if the window's title bar is visible enough to make sure the window can be moved.
…he window is created
…tead of the actual position
@pfaion Please give this recovery logic a try on Windows. Please try it with different multi-screen setups, i.e. disconnected screen to the left/top/bottom/right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was suggesting to use typing.NamedTuple
, I was mostly referring to using the type annotation possibility to define the tuple, making it more readable. Please adopt the type annotation variant accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine in different window layouts!
This PR fixes issues related to windows being outside the display bounds when recovering a session.