Fixed dialog placement on a multiple-display setup.#614
Open
Micheus wants to merge 2 commits intodgud:masterfrom
Open
Fixed dialog placement on a multiple-display setup.#614Micheus wants to merge 2 commits intodgud:masterfrom
Micheus wants to merge 2 commits intodgud:masterfrom
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.
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.
Owner
|
I'm just testing copilot |
Owner
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
