enaml
enaml copied to clipboard
Workaround multi-display issues on X11 with popups
For #499. This disables the on screen checks to fix weird positioning of popups on X11 when multiple displays are present. Tested with QT 5.15 and 6.3.1 with 2 and 3 FHD monitors in a horizontal row.
The desktop notification of the popup example is still showing on the primary desktop.
If anyone else is able to test it would be appreciated.
Codecov Report
Merging #500 (cf3ca4c) into main (2c65e09) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #500 +/- ##
=======================================
Coverage 74.45% 74.45%
=======================================
Files 317 317
Lines 24123 24126 +3
Branches 55 55
=======================================
+ Hits 17961 17964 +3
Misses 6162 6162
When you get a chance to test, can you add prints in _layoutPlainRect and see what the desktop notification does on each screen on windows or osx?
With wayland the values do not change from one screen to another, all values seem to be relative to the current screen or window. On X11 the values seem to have an offset for each screen (so all screens act like one big screen).
Wayland
Window notification on Wayland... same for all 3
# Screen 1
target_pos=PyQt6.QtCore.QPoint(400, 166)
anchor_pos=PyQt6.QtCore.QPoint(200, 41)
trial_geo=PyQt6.QtCore.QRect(190, 115, 200, 41)
geo=PyQt6.QtCore.QRect(190, 115, 200, 41)
# Screen 2
target_pos=PyQt6.QtCore.QPoint(400, 166)
anchor_pos=PyQt6.QtCore.QPoint(200, 41)
trial_geo=PyQt6.QtCore.QRect(190, 115, 200, 41)
geo=PyQt6.QtCore.QRect(190, 115, 200, 41)
# Screen 3
target_pos=PyQt6.QtCore.QPoint(400, 166)
anchor_pos=PyQt6.QtCore.QPoint(200, 41)
trial_geo=PyQt6.QtCore.QRect(190, 115, 200, 41)
geo=PyQt6.QtCore.QRect(190, 115, 200, 41)
X11
Window notification on X11...
# Screen 1
target_pos=PyQt6.QtCore.QPoint(1415, 632)
anchor_pos=PyQt6.QtCore.QPoint(200, 41)
trial_geo=PyQt6.QtCore.QRect(1205, 581, 200, 41)
geo=PyQt6.QtCore.QRect(1205, 581, 200, 41)
# Screen 2
target_pos=PyQt6.QtCore.QPoint(2880, 688)
anchor_pos=PyQt6.QtCore.QPoint(200, 41)
trial_geo=PyQt6.QtCore.QRect(2670, 637, 200, 41)
geo=PyQt6.QtCore.QRect(2670, 637, 200, 41)
# Screen 3
target_pos=PyQt6.QtCore.QPoint(4812, 679)
anchor_pos=PyQt6.QtCore.QPoint(200, 41)
trial_geo=PyQt6.QtCore.QRect(4602, 628, 200, 41)
geo=PyQt6.QtCore.QRect(4602, 628, 200, 41)
This is with the patch. Without the patch the geo is always clamped to the bounds of the first screen.
Here is what I get on my main screen with the popup view example: window notification target_pos=PyQt5.QtCore.QPoint(1160, 477) anchor_pos=PyQt5.QtCore.QPoint(200, 36) trial_pos=PyQt5.QtCore.QPoint(950, 431) trial_geo=PyQt5.QtCore.QRect(950, 431, 200, 36) geo=PyQt5.QtCore.QRect(950, 431, 200, 36) desktop notification target_pos=PyQt5.QtCore.QPoint(1920, 1030) anchor_pos=PyQt5.QtCore.QPoint(200, 36) trial_pos=PyQt5.QtCore.QPoint(1710, 984) trial_geo=PyQt5.QtCore.QRect(1710, 984, 200, 36) geo=PyQt5.QtCore.QRect(1710, 984, 200, 36) mouse notification target_pos=PyQt5.QtCore.QPoint(956, 460) anchor_pos=PyQt5.QtCore.QPoint() trial_pos=PyQt5.QtCore.QPoint(956, 460) trial_geo=PyQt5.QtCore.QRect(956, 460, 200, 36) geo=PyQt5.QtCore.QRect(956, 460, 200, 36)
This is what I get in my secondary screen: window notification target_pos=PyQt5.QtCore.QPoint(-660, 217) anchor_pos=PyQt5.QtCore.QPoint(200, 36) trial_pos=PyQt5.QtCore.QPoint(-870, 171) trial_geo=PyQt5.QtCore.QRect(-870, 171, 200, 36) geo=PyQt5.QtCore.QRect(-870, 171, 200, 36) desktop notification target_pos=PyQt5.QtCore.QPoint(1920, 1030) anchor_pos=PyQt5.QtCore.QPoint(200, 36) trial_pos=PyQt5.QtCore.QPoint(1710, 984) trial_geo=PyQt5.QtCore.QRect(1710, 984, 200, 36) geo=PyQt5.QtCore.QRect(-200, 787, 200, 36) mouse notification target_pos=PyQt5.QtCore.QPoint(-908, 195) anchor_pos=PyQt5.QtCore.QPoint() trial_pos=PyQt5.QtCore.QPoint(-908, 195) trial_geo=PyQt5.QtCore.QRect(-908, 195, 200, 36) geo=PyQt5.QtCore.QRect(-908, 195, 200, 36)
However I noticed that the show config popup is broken and does not show in the right place when the parent is on the secondary screen. I need to investigate.
It appears I did a less than perfect job back in fded4b84 (before 0.12.0). I took the liberty to push a commit that appears to fix the issue. I wonder if it could fix your X11 issue, could you test ?
Without the original change it is still messed up on X11.
Edit: sorry I had the wrong commit. It fixes the config popup and window popup but the mouse notification is still on the wrong screen.
Thanks for testing ! so we keep both changes then. I will take care of the release notes later once #503 goes in. BTW could you have a look at it ?
I updated the title since I found more issues on Windows