Skip to content

Conversation

@Micheus
Copy link
Collaborator

@Micheus Micheus commented Mar 28, 2025

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
IMG_20250327_161128


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


Result for the centred window (before and after)
IMG_20250327_140931

IMG_20250327_161126

@AleksFM
Copy link

AleksFM commented Jun 12, 2025

Thank you @Micheus ! I hope this will help users with some non-traditional monitor setups to avoid some extra dialog reposition work.

@dgud dgud requested a review from Copilot July 4, 2025 10:12
Copy link

Copilot AI left a 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 use centerOnParent when more than one display is connected.

@dgud
Copy link
Owner

dgud commented Jul 4, 2025

I'm just testing copilot

@dgud
Copy link
Owner

dgud commented Dec 2, 2025

I have let co-pilot review this, fix stuff that seems valid and write when your are done, or nothing needs fixing.
It is wrong often.

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.
@Micheus Micheus force-pushed the mv/v2.4-fix-dialog-on-displays branch from d5b3d4e to c8bba19 Compare December 16, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants