-
Notifications
You must be signed in to change notification settings - Fork 97
Fixed dialog placement on a multiple-display setup. #614
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you @Micheus ! I hope this will help users with some non-traditional monitor setups to avoid some extra dialog reposition work. |
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.
Pull Request Overview
This PR improves dialog placement on multi-display setups by detecting the display under the mouse pointer to compute better positions and adjusts centering behavior when multiple monitors are present.
- Added display-aware logic to
set_position(mouse, Dialog)for correct positioning with display geometry and scaling. - Updated
set_position(center, Dialog)to usecenterOnParentwhen more than one display is connected.
|
I'm just testing copilot |
|
I have let co-pilot review this, fix stuff that seems valid and write when your are done, or nothing needs fixing. |
A Discord user, Aleks M, reported an issue with his setup, which included two displays (one horizontal and one vertical). When the dialog was invoked with the mouse near the left border of the vertical display, the dialog was cut off. To address this, I updated the code to evaluate which display the mouse was on, and used its geometry to compute the optimal position for showing the dialog. This solution worked well; however, in cases where the display uses scaling (via the OS), the dialog's position can still vary slightly, sometimes ending up farther from the mouse pointer than expected. I also addressed an issue with the option to display centered dialogs. On multiple displays, the dialog could sometimes be positioned across the frame of the displays, resulting in only half of it being visible on each display, which was quite annoying.
d5b3d4e to
c8bba19
Compare
A Discord user, Aleks M, reported an issue with his setup, which included two displays (one horizontal and one vertical). When the dialog was invoked with the mouse near the left border of the vertical display, the dialog was cut off.
To address this, I updated the code to evaluate which display the mouse was on, and used its geometry to compute the optimal position for showing the dialog. This solution worked well; however, in cases where the display uses scaling (via the OS), the dialog's position can still vary slightly, sometimes ending up farther from the mouse pointer than expected.
I also addressed an issue with the option to display centred dialogs. On multiple displays, the dialog could sometimes be positioned across the frame of the displays, resulting in only half of it being visible on each display, which was quite annoying.
NOTE: Fixed dialog placement on a multiple-display setup. Thanks to Aleks M.
Issue reported

Results for dialog placement (Issue when exists a scaled display and better locations)



Result for the centred window (before and after)
