SUMMARY When taking a screenshot and selecting a rectangular region on Wayland, Spectacle draws the rectangle and takes the screenshot on the wrong screen. You can later drag the rectangle to the "correct" screen, but if you resize the rectangle using handles, Spectacle will place the rectangle in the wrong screen again. STEPS TO REPRODUCE 1. Take a snapshot 2. Press "Rectangular Region" button 3. Draw a rectangle on a screen (in my case, I use a laptop and I draw a rectangle on my primary, external screen) OBSERVED RESULT Spectacle draws the rectangle and takes the screenshot on the corresponding pixel of the other screen (internal, secondary) EXPECTED RESULT Spectacle draws the rectangle and takes the screenshot under the cursor SOFTWARE/OS VERSIONS Linux/KDE Plasma: Manjaro, kernel 6.12.17-1 KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2
I can't reproduce this issue with multiple screens on current git master.
I can reproduce on Plasma 6.3.3 on Arch Linux. I have two screens arranged vertically, both using fractional scaling with each screen using a different scale factor.
In my setting, the screens are laid out horizontally, share the same fractional scaling (namely 140%) but different resolutions (2560x1440 the external primary screen, positioned at the left, 1920x1080 the built-in screen, positioned at the right).
I am also not able to reproduce this on git-master Wayland with two screens Laptop 1920 x 1080 Monitor 3440 x 1440 Both set to 140% Tested with the laptop to the left,and then to the right I also tested with different scale factors Also unable to reproduce on Plasma 6.3.3 I'll leave this open in case someone else is able to reproduce
I'm not sure if that's relevant for screenshots, but I'm on pipewire 1.4.0, which was released very recently.
I have another observation that might help identify the problem. Currently, I am working with an external primary screen positioned to the left of the laptop screen. If I reposition the external screen to the right, either by dragging the screen in the display configuration settings or by selecting "Extend to right" in the system tray widget, the bug disappears. When I move the external screen back to the left, the bug reappears.
Since there seems to be issues in reproducing the problem, I'll tune in with my setup and some observations and tests I've run: Monitor 1: 2560x2880 (_not_ rotated. Its the LG DualUp, which is why the resolution is weird.) Monitor 2: 3840x2160, primary display My layout is monitor 1 to the left and monitor 2 to the right, both at 150% scaling. The issue is with selecting a region on monitor 1, where instead spectacle shows that it has selected a region on monitor 2. Observation 1: The issue is unaffected by whether bottom of the monitors are aligned or not. Observation 2: If I move monitor 1 to the right of monitor 2, the issue goes away. Observation 3: Keeping monitor 1 at 150% scaling, the issue is unaffected when changing the scaling of monitor 2. Observation 4: Keeping with monitor 2 at 150% scaling (and also at 100% scaling), the issue is only sometimes present when I change the scaling on monitor 1. Specifically, the issue is only present at 140%, 145%, 150%, 155%, (not 160%,) and 165% and not above/below these scaling factors. Observation 5: The issue is unaffected by which monitor is set as the primary display. Observation 6: When the issue is present, if I select an area on monitor 2, then mouse over "the same area" on monitor 1 (as if the two monitors were placed on top of each other) I see the "hand"-cursor and can drag the region around despite it being on the other monitor. Please reach out if I need to clarify anything, or if I should run additional tests. :-) KDE Plasma Version: 6.3.4 KDE Frameworks Version: 6.12.0 Qt Version: 6.8.3 Kernel Version: 6.13.8-arch1-1 Graphics Platform: Wayland
So I did some debugging, and I don't believe it's a problem in Spectacle: I went as far back as commit 9952d507, and the issue is still present. I also inserted some debug output to figure out what's going wrong. To understand the outputs, here is my setup in detail: laptop screen: 2880x1800, 150% scale, bottom external screen: 3840x2160, 130% scale, top and I'm trying to select a rectangular region on the top (external) screen. - the viewport rectangles in ImageCaptureOverlay.qml are correct: QRectF(0, 0, 2954, 1662) and QRectF(560, 1662, 1920, 1200) - the raw event->scenePosition() and the calculated scenePosition in SelectionEditor.cpp::mousePressEvent are also correct: QPointF(1157,849) and QPointF(1157,849) - the calculated logical global mouse position (d->mousePos) is incorrect: QPointF(1717,2511) - turns out, the window position in the event itself (item->window()->position()) is incorrect: QPoint(560,1662) This only happens in the configuration described above, switching the positions of the screens (laptop screen on top, external screen bottom) works correctly. As far as I understand, item->window()->position() is coming directly from Qt, so it's either a Qt or a kwin bug, I suppose. I'm still on Qt 6.8.2, haven't tried with 6.9 yet.
Hmm, on Qt 6.8.2, I can't reproduce that issue with my external screen positioned above the laptop screen (they have mixed DPI like yours). Can't reproduce with the upper screen centered or off to the right side such that the 0,0 position of the entire area doesn't fall on a screen.
Ultimately this is Bug 502047, and we simply haven't figure out a set of steps that reproduce it for everyone. *** This bug has been marked as a duplicate of bug 502047 ***