| Summary: | Rectangular Region selects on wrong screen with certain screen setups | ||
|---|---|---|---|
| Product: | [Applications] Spectacle | Reporter: | Jovan Pavlovic <jovan.pavlovic99> |
| Component: | General | Assignee: | Noah Davis <noahadvs> |
| Status: | VERIFIED FIXED | ||
| Severity: | normal | CC: | ariadnyx, arthurian803, bundyo, burner+kde, frostynova, gjz010944, ilia-kats, john.kizer, kde, kdedev, l.allulli, lynn, madness742, mail, nate, olib141, shoop |
| Priority: | HI | Keywords: | multiscreen |
| Version First Reported In: | 6.3.3 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/spectacle/-/commit/64e46b80e621e48f6e7fc9eff555c320d327457b | Version Fixed/Implemented In: | 6.4.0 |
| Sentry Crash Report: | |||
| Attachments: |
Showcase of bug
Display arrangement used to reproduce bug, with a marked section of where to take a screenshot. |
||
|
Description
Jovan Pavlovic
2025-03-26 21:48:55 UTC
This issue has been seen by another user with 150% scale, I'm collecting more information from them. Can you, Jovan, please provide the output of the following command: kscreen-console outputs Additionally, do you see this issue with the monitors positioned in the opposite configuration? (i.e. with your HP display on the left? Please make sure the command output provided is with the original display configuration where this problem is seen!) I'm not able to reproduce this at all on git master with multiple screens (laptop 14" 2880x1800@175% + external 23" 2560x1440@100%) no matter how I arrange them. *** Bug 502207 has been marked as a duplicate of this bug. *** (In reply to Oliver Beard from comment #1) > This issue has been seen by another user with 150% scale, I'm collecting > more information from them. > > Can you, Jovan, please provide the output of the following command: > kscreen-console outputs kscreen-console outputs START: Requesting Config Received config. Took 4 milliseconds Screen: maxSize: QSize(64000, 64000) minSize: QSize(0, 0) currentSize: QSize(3414, 960) ----------------------------------------------------- Id: 1 Name: "DP-1" Type: "DisplayPort" Connected: true Enabled: true Priority: 2 Rotation: KScreen::Output::None Pos: QPoint(1707,0) MMSize: QSize(597, 336) FollowPreferredMode: false Size: QSize(2560, 1440) Scale: 1.5 Clones: None Mode: "2" Preferred Mode: "1" Preferred modes: QList("1") Modes: "1" "2560x1440@60" QSize(2560, 1440) 59.951 "10" "1920x1080@60" QSize(1920, 1080) 60 "11" "1920x1080@60" QSize(1920, 1080) 60 "12" "1920x1080@60" QSize(1920, 1080) 59.94 "13" "1600x1200@60" QSize(1600, 1200) 59.951 "14" "1680x1050@60" QSize(1680, 1050) 59.954 "15" "1600x900@60" QSize(1600, 900) 60 "16" "1280x1024@75" QSize(1280, 1024) 75.025 "17" "1280x1024@60" QSize(1280, 1024) 60.02 "18" "1440x900@60" QSize(1440, 900) 59.887 "19" "1280x800@60" QSize(1280, 800) 59.81 "2" "2560x1440@165" QSize(2560, 1440) 164.834 "20" "1280x720@60" QSize(1280, 720) 60 "21" "1280x720@60" QSize(1280, 720) 60 "22" "1280x720@60" QSize(1280, 720) 59.94 "23" "1024x768@75" QSize(1024, 768) 75.029 "24" "1024x768@60" QSize(1024, 768) 60.004 "25" "800x600@75" QSize(800, 600) 75 "26" "800x600@60" QSize(800, 600) 60.317 "27" "720x480@60" QSize(720, 480) 60 "28" "720x480@60" QSize(720, 480) 60 "29" "720x480@60" QSize(720, 480) 59.94 "3" "2560x1440@144" QSize(2560, 1440) 143.973 "30" "720x480@60" QSize(720, 480) 59.94 "31" "640x480@75" QSize(640, 480) 75 "32" "640x480@60" QSize(640, 480) 60 "33" "640x480@60" QSize(640, 480) 59.94 "34" "640x480@60" QSize(640, 480) 59.94 "35" "720x400@70" QSize(720, 400) 70.082 "36" "1600x1200@60" QSize(1600, 1200) 59.869 "37" "1280x1024@60" QSize(1280, 1024) 59.895 "38" "1024x768@60" QSize(1024, 768) 59.92 "39" "2560x1440@60" QSize(2560, 1440) 59.961 "4" "2560x1440@120" QSize(2560, 1440) 119.998 "40" "1920x1080@60" QSize(1920, 1080) 59.963 "41" "1600x900@60" QSize(1600, 900) 59.946 "42" "1368x768@60" QSize(1368, 768) 59.882 "43" "1280x720@60" QSize(1280, 720) 59.855 "5" "2560x1440@75" QSize(2560, 1440) 74.971 "6" "1920x1200@60" QSize(1920, 1200) 59.885 "7" "1920x1080@120" QSize(1920, 1080) 120 "8" "1920x1080@120" QSize(1920, 1080) 119.88 "9" "1920x1080@100" QSize(1920, 1080) 100 EDID Info: Device ID: "xrandr-HP Inc.-OMEN 27q-CNC3232K8F" Name: "OMEN 27q" Vendor: "HP Inc." Serial: "CNC3232K8F" EISA ID: "" Hash: "7997badb50a48267c23bcec31525ae70" Width: 60 Height: 34 Gamma: 2.2 Red: QQuaternion(scalar:1, vector:(0.68457, 0.308594, 0)) Green: QQuaternion(scalar:1, vector:(0.277344, 0.648438, 0)) Blue: QQuaternion(scalar:1, vector:(0.144531, 0.0595703, 0)) White: QQuaternion(scalar:1, vector:(0.313477, 0.329102, 0)) ----------------------------------------------------- Id: 2 Name: "DP-2" Type: "DisplayPort" Connected: true Enabled: true Priority: 1 Rotation: KScreen::Output::None Pos: QPoint(0,0) MMSize: QSize(596, 335) FollowPreferredMode: false Size: QSize(2560, 1440) Scale: 1.5 Clones: None Mode: "46" Preferred Mode: "44" Preferred modes: QList("44") Modes: "44" "2560x1440@60" QSize(2560, 1440) 59.94 "45" "2560x1440@170" QSize(2560, 1440) 169.831 "46" "2560x1440@165" QSize(2560, 1440) 164.802 "47" "2560x1440@144" QSize(2560, 1440) 143.856 "48" "2560x1440@120" QSize(2560, 1440) 119.879 "49" "1920x1200@60" QSize(1920, 1200) 59.94 "50" "1920x1080@144" QSize(1920, 1080) 143.854 "51" "1920x1080@120" QSize(1920, 1080) 120 "52" "1920x1080@120" QSize(1920, 1080) 119.88 "53" "1920x1080@60" QSize(1920, 1080) 60 "54" "1920x1080@60" QSize(1920, 1080) 60 "55" "1920x1080@60" QSize(1920, 1080) 59.94 "56" "1600x1200@60" QSize(1600, 1200) 59.94 "57" "1680x1050@60" QSize(1680, 1050) 59.954 "58" "1280x1024@75" QSize(1280, 1024) 75.025 "59" "1280x1024@60" QSize(1280, 1024) 60.02 "60" "1440x900@60" QSize(1440, 900) 59.887 "61" "1280x800@60" QSize(1280, 800) 59.94 "62" "1280x720@120" QSize(1280, 720) 120 "63" "1280x720@120" QSize(1280, 720) 119.88 "64" "1280x720@60" QSize(1280, 720) 60 "65" "1280x720@60" QSize(1280, 720) 59.94 "66" "1024x768@75" QSize(1024, 768) 75.029 "67" "1024x768@70" QSize(1024, 768) 70.069 "68" "1024x768@60" QSize(1024, 768) 60.004 "69" "800x600@75" QSize(800, 600) 75 "70" "800x600@72" QSize(800, 600) 72.188 "71" "800x600@60" QSize(800, 600) 60.317 "72" "800x600@56" QSize(800, 600) 56.25 "73" "720x576@50" QSize(720, 576) 50 "74" "720x576@50" QSize(720, 576) 50 "75" "720x480@60" QSize(720, 480) 60 "76" "720x480@60" QSize(720, 480) 60 "77" "720x480@60" QSize(720, 480) 59.94 "78" "720x480@60" QSize(720, 480) 59.94 "79" "640x480@75" QSize(640, 480) 75 "80" "640x480@73" QSize(640, 480) 72.809 "81" "640x480@60" QSize(640, 480) 60 "82" "640x480@60" QSize(640, 480) 59.94 "83" "1600x1200@60" QSize(1600, 1200) 59.869 "84" "1280x1024@60" QSize(1280, 1024) 59.895 "85" "1024x768@60" QSize(1024, 768) 59.92 "86" "1920x1200@60" QSize(1920, 1200) 59.885 "87" "1280x800@60" QSize(1280, 800) 59.81 "88" "2560x1440@60" QSize(2560, 1440) 59.961 "89" "1920x1080@60" QSize(1920, 1080) 59.963 "90" "1600x900@60" QSize(1600, 900) 59.946 "91" "1368x768@60" QSize(1368, 768) 59.882 "92" "1280x720@60" QSize(1280, 720) 59.855 EDID Info: Device ID: "xrandr-GIGA-BYTE TECHNOLOGY CO., LTD.-M27Q-21030B003556" Name: "M27Q" Vendor: "GIGA-BYTE TECHNOLOGY CO., LTD." Serial: "21030B003556" EISA ID: "" Hash: "e6936a5014da6874870f25e52cfe452a" Width: 70 Height: 39 Gamma: 2.2 Red: QQuaternion(scalar:1, vector:(0.655273, 0.324219, 0)) Green: QQuaternion(scalar:1, vector:(0.208984, 0.713867, 0)) Blue: QQuaternion(scalar:1, vector:(0.146484, 0.0507813, 0)) White: QQuaternion(scalar:1, vector:(0.313477, 0.329102, 0)) (In reply to Oliver Beard from comment #2) > Additionally, do you see this issue with the monitors positioned in the > opposite configuration? (i.e. with your HP display on the left? Please make > sure the command output provided is with the original display configuration > where this problem is seen!) Just tried moving HP omen screen view around gigabyte monitor and bug cannot be reproduced only when gigabyte is left and hp is right I can confirm that I’m also experiencing this issue, although with a different monitor layout. My setup consists of one large monitor on top and two smaller monitors below it. The top monitor is scaled to 110%, and the two bottom ones are scaled to 115%. When I use the rectangular region capture in Spectacle, the selection overlay appears on the wrong screen, similar to what's described. I’ve attached a screenshot showing how it looks during the capture process. https://postimg.cc/S2HkNgWY Let me know if you need any additional info. *** Bug 500555 has been marked as a duplicate of this bug. *** *** Bug 502473 has been marked as a duplicate of this bug. *** *** Bug 502909 has been marked as a duplicate of this bug. *** I have a similar issue since I upgraded from Fedora 41 to 42: https://bugs.kde.org/show_bug.cgi?id=502909 Here's my setup: https://postimg.cc/jCbSYcWs *** Bug 501177 has been marked as a duplicate of this bug. *** I've spent a decent amount of time this afternoon trying to reproduce this, with no success so far I've tried with two different laptops running git-master plasma - one has an AMD GPU, the other an NVIDIA I've tried variations in Display positions (horizontally and vertically) 2 or 3 displays Native vs non-native resolution Different scale factors I would be willing to try to debug this myself. Could you lads give me pointers on how to attach debugger on spectacle and some initial function where screen selection should start? (In reply to Jovan Pavlovic from comment #14) > I would be willing to try to debug this myself. > Could you lads give me pointers on how to attach debugger on spectacle and > some initial function where screen selection should start? I've already done some debugging over here: https://bugs.kde.org/show_bug.cgi?id=501177#c8 (In reply to hobs from comment #11) > I have a similar issue since I upgraded from Fedora 41 to 42: > https://bugs.kde.org/show_bug.cgi?id=502909 > > Here's my setup: https://postimg.cc/jCbSYcWs https://postimg.cc/XrZ7CyH7 I tried it on my 2. desk. When I want to make a screenshot on the left top screen, the screenshot is taken on the left bottom one. Screenshotting on other screens work as expected. Not sure how this helps, but if anyone has an idea what I can check additionally, please let me know. Thanks for the screen shot of your display setup. Can you attach that directly to the bug report? That way it won't be lost even if the link goes dead. Created attachment 180662 [details]
Display arrangement used to reproduce bug, with a marked section of where to take a screenshot.
I think I have figured out the root cause... or something close to it.
---- How to forcibly recreate the issue on any PC ----
1. Have a setup with 2 (or more) displays.
2. In the "display configuration" settings place your displays so that they are overlapping, and with one of them being larger than the other/sticking out to a side. Using display scaling to make one display much larger than the other is an easy way to make them stick out.
3. Open the rectangular region select in spectacle, and select an area which is only shown on one display (i.e. in the part that is sticking out).
I've had success based on which part of which display is sticking out, and if I select an area to the top/bottom/left/right of the inner display. So if it doesn't work, swap which display is large and which is small.
(See the attached picture, if my explanation isn't clear. The red rectangle is the area that I try to take a screenshot of.)
---- Why it happens (seemingly) randomly ----
I have a strong suspicion that sometimes KWin and Spectacle disagree on the resolution of displays when using fractional scaling.
With my setup (where the bug is present) `the display is set to 2560x2880 with 150% scaling.
If I take a full screen screenshot using the "current screen" option in spectacle, the resolution is 2561x1440.
This suggests that spectacle (or QT or something else) thinks that the display is 1 pixel wider than what KWin thinks, and if I then place that display to the left, the displays will overlap by 1 pixel, causing the issue.
---- My (unqualified) guess on what causes the issue / what to look for in the code ----
I think there are two bugs which would fix this issue, and I don't know which one is easier to fix (probably nr. 1).
1. There is a math issue somewhere in the code (duh!).
In my tests the issue only seems to be present when `resolution/scaling factor` calculation results in the fractional part being above .5 (i.e. it would be rounded up), which suggests a rounding error... I have however also found a case where the faction is above .5 and the bug isn't present, so it is only a hunch.
I guess this relates to how "weird" resolutions causes the issue. I have another PC setup where I couldn't reproduce the issue, but once I switched to a 1368x768 resolution, it became much easier to reproduce it without purposefully overlapping the displays.
2. If you have overlapping displays, Spectacle seemingly takes your mouse offset relative to the top left corner of one display, then selects an area with the same offset but relative to the other display's top left corner.
Sorry for rambling ;)
I made a typo. The screenshot resolution was 2561x2880, not 2561x1440. (In reply to Jonas Ryssel from comment #18) > If I take a full screen screenshot using the "current screen" option in > spectacle, the resolution is 2561x1440. Come to add "me too". I have two displays side by side (display scaling 118,75% if matters, most likely not). When I try to take a screenshot of whole screen, it presents me panorama of boths screens shown on main display. When I select area on that "combined" screen and confirm, then it returns to normal display (every screen on its own) but **then** takes the screenshot and try to crop according to area I selected. But as it is after combined screen is gone, the offset is wrong (I got [Laptop][Display] while "Display" is my main and is huge resolution. So on "screnshot" "laptop" is inserted on the left side, and shifts the "Display" screen "laptop"'s width to the right. So final crop in my case, if target area was on "Display" is shifted by "Laptop"'s screen width. I can confirm I have this issue with three 3840x2160, lined horizontally, with the middle monitor rotated 90 degrees clockwise at 150% scaling.
The middle monitor is the only one that has problems, both unrotated monitors are able to work fine without issue.
kscreen-console outputs
START: Requesting Config
Received config. Took 3 milliseconds
Screen:
maxSize: QSize(64000, 64000)
minSize: QSize(0, 0)
currentSize: QSize(6514, 1674)
-----------------------------------------------------
Id: 1
Name: "DP-1"
Type: "DisplayPort"
Connected: true
Enabled: true
Priority: 2
Rotation: KScreen::Output::None
Pos: QPoint(3954,234)
MMSize: QSize(699, 395)
FollowPreferredMode: false
Size: QSize(3840, 2160)
Scale: 1.5
Clones: None
Mode: "2"
Preferred Mode: "1"
Preferred modes: QList("1")
Modes:
"1" "3840x2160@60" QSize(3840, 2160) 60
"10" "1920x1080@240" QSize(1920, 1080) 239.884
"11" "1920x1080@120" QSize(1920, 1080) 120
"12" "1920x1080@120" QSize(1920, 1080) 119.88
"13" "1920x1080@60" QSize(1920, 1080) 60
"14" "1920x1080@60" QSize(1920, 1080) 60
"15" "1920x1080@60" QSize(1920, 1080) 59.94
"16" "1600x1200@60" QSize(1600, 1200) 60
"17" "1680x1050@60" QSize(1680, 1050) 59.954
"18" "1280x1024@75" QSize(1280, 1024) 75.025
"19" "1440x900@60" QSize(1440, 900) 59.887
"2" "3840x2160@240" QSize(3840, 2160) 239.99
"20" "1280x960@60" QSize(1280, 960) 60
"21" "1280x800@60" QSize(1280, 800) 60
"22" "1152x864@75" QSize(1152, 864) 75
"23" "1280x720@120" QSize(1280, 720) 120
"24" "1280x720@120" QSize(1280, 720) 119.88
"25" "1280x720@60" QSize(1280, 720) 60
"26" "1280x720@60" QSize(1280, 720) 60
"27" "1280x720@60" QSize(1280, 720) 59.94
"28" "1280x720@50" QSize(1280, 720) 50
"29" "1024x768@75" QSize(1024, 768) 75.029
"3" "3840x2160@180" QSize(3840, 2160) 179.999
"30" "1024x768@70" QSize(1024, 768) 70.069
"31" "1024x768@60" QSize(1024, 768) 60.004
"32" "800x600@75" QSize(800, 600) 75
"33" "800x600@72" QSize(800, 600) 72.188
"34" "800x600@60" QSize(800, 600) 60.317
"35" "800x600@56" QSize(800, 600) 56.25
"36" "640x480@75" QSize(640, 480) 75
"37" "640x480@73" QSize(640, 480) 72.809
"38" "640x480@67" QSize(640, 480) 66.667
"39" "640x480@60" QSize(640, 480) 60
"4" "3840x2160@120" QSize(3840, 2160) 119.999
"40" "640x480@60" QSize(640, 480) 59.94
"41" "640x480@60" QSize(640, 480) 59.94
"42" "720x400@70" QSize(720, 400) 70.082
"43" "1600x1200@60" QSize(1600, 1200) 59.869
"44" "1280x1024@60" QSize(1280, 1024) 59.895
"45" "1024x768@60" QSize(1024, 768) 59.92
"46" "2560x1600@60" QSize(2560, 1600) 59.987
"47" "1920x1200@60" QSize(1920, 1200) 59.885
"48" "1280x800@60" QSize(1280, 800) 59.81
"49" "3840x2160@60" QSize(3840, 2160) 59.981
"5" "3840x2160@60" QSize(3840, 2160) 59.94
"50" "3200x1800@60" QSize(3200, 1800) 59.956
"51" "2880x1620@60" QSize(2880, 1620) 59.96
"52" "2560x1440@60" QSize(2560, 1440) 59.961
"53" "1920x1080@60" QSize(1920, 1080) 59.963
"54" "1600x900@60" QSize(1600, 900) 59.946
"55" "1368x768@60" QSize(1368, 768) 59.882
"56" "1280x720@60" QSize(1280, 720) 59.855
"6" "2560x1440@240" QSize(2560, 1440) 239.847
"7" "2560x1440@120" QSize(2560, 1440) 119.998
"8" "2560x1440@60" QSize(2560, 1440) 59.951
"9" "1920x1200@60" QSize(1920, 1200) 60
EDID Info:
Device ID: "xrandr-Microstep-MAG321UX OLED"
Name: "MAG321UX OLED"
Vendor: "Microstep"
Serial: ""
EISA ID: ""
Hash: "06709fadcd3b434a9f6fc8cae331fa66"
Width: 70
Height: 40
Gamma: 2.2
Red: QQuaternion(scalar:1, vector:(0.683594, 0.304688, 0))
Green: QQuaternion(scalar:1, vector:(0.244141, 0.708984, 0))
Blue: QQuaternion(scalar:1, vector:(0.143555, 0.0556641, 0))
White: QQuaternion(scalar:1, vector:(0.313477, 0.329102, 0))
-----------------------------------------------------
Id: 2
Name: "DP-2"
Type: "DisplayPort"
Connected: true
Enabled: true
Priority: 3
Rotation: KScreen::Output::Left
Pos: QPoint(2560,0)
MMSize: QSize(697, 392)
FollowPreferredMode: false
Size: QSize(2160, 3840)
Scale: 1.55
Clones: None
Mode: "57"
Preferred Mode: "57"
Preferred modes: QList("57")
Modes:
"57" "3840x2160@60" QSize(3840, 2160) 59.997
"58" "3840x2160@64" QSize(3840, 2160) 64
"59" "3840x2160@30" QSize(3840, 2160) 30
"60" "2560x1440@60" QSize(2560, 1440) 59.951
"61" "1920x1200@60" QSize(1920, 1200) 59.997
"62" "1920x1080@60" QSize(1920, 1080) 60
"63" "1920x1080@60" QSize(1920, 1080) 60
"64" "1920x1080@60" QSize(1920, 1080) 59.94
"65" "1600x1200@60" QSize(1600, 1200) 59.997
"66" "1680x1050@60" QSize(1680, 1050) 59.954
"67" "1280x1024@60" QSize(1280, 1024) 60.02
"68" "1440x900@60" QSize(1440, 900) 59.887
"69" "1280x960@60" QSize(1280, 960) 60
"70" "1280x800@60" QSize(1280, 800) 59.81
"71" "1280x720@60" QSize(1280, 720) 60
"72" "1280x720@60" QSize(1280, 720) 60
"73" "1280x720@60" QSize(1280, 720) 59.94
"74" "1024x768@60" QSize(1024, 768) 60.004
"75" "800x600@60" QSize(800, 600) 60.317
"76" "800x600@56" QSize(800, 600) 56.25
"77" "720x576@50" QSize(720, 576) 50
"78" "720x480@60" QSize(720, 480) 60
"79" "720x480@60" QSize(720, 480) 59.94
"80" "640x480@60" QSize(640, 480) 60
"81" "640x480@60" QSize(640, 480) 59.94
"82" "1600x1200@60" QSize(1600, 1200) 59.869
"83" "1280x1024@60" QSize(1280, 1024) 59.895
"84" "1024x768@60" QSize(1024, 768) 59.92
"85" "2560x1600@60" QSize(2560, 1600) 59.987
"86" "1920x1200@60" QSize(1920, 1200) 59.885
"87" "3840x2160@60" QSize(3840, 2160) 59.981
"88" "3200x1800@60" QSize(3200, 1800) 59.956
"89" "2880x1620@60" QSize(2880, 1620) 59.96
"90" "2560x1440@60" QSize(2560, 1440) 59.961
"91" "1920x1080@60" QSize(1920, 1080) 59.963
"92" "1600x900@60" QSize(1600, 900) 59.946
"93" "1368x768@60" QSize(1368, 768) 59.882
"94" "1280x720@60" QSize(1280, 720) 59.855
EDID Info:
Device ID: "xrandr-Sceptre Tech Inc-Sceptre Z32"
Name: "Sceptre Z32"
Vendor: "Sceptre Tech Inc"
Serial: ""
EISA ID: ""
Hash: "4c553988482b109e72eb534bec5865ea"
Width: 70
Height: 39
Gamma: 2.2
Red: QQuaternion(scalar:1, vector:(0.669922, 0.3125, 0))
Green: QQuaternion(scalar:1, vector:(0.327148, 0.639648, 0))
Blue: QQuaternion(scalar:1, vector:(0.135742, 0.0693359, 0))
White: QQuaternion(scalar:1, vector:(0.3125, 0.328125, 0))
-----------------------------------------------------
Id: 3
Name: "DP-3"
Type: "DisplayPort"
Connected: true
Enabled: true
Priority: 1
Rotation: KScreen::Output::None
Pos: QPoint(0,234)
MMSize: QSize(708, 399)
FollowPreferredMode: false
Size: QSize(3840, 2160)
Scale: 1.5
Clones: None
Mode: "95"
Preferred Mode: "95"
Preferred modes: QList("95")
Modes:
"100" "2560x1440@60" QSize(2560, 1440) 59.951
"101" "1920x1200@61" QSize(1920, 1200) 61
"102" "1920x1080@60" QSize(1920, 1080) 60
"103" "1920x1080@60" QSize(1920, 1080) 60
"104" "1920x1080@60" QSize(1920, 1080) 59.94
"105" "1920x1080@50" QSize(1920, 1080) 50
"106" "1600x1200@61" QSize(1600, 1200) 61
"107" "1680x1050@60" QSize(1680, 1050) 59.954
"108" "1600x900@60" QSize(1600, 900) 60
"109" "1280x1024@75" QSize(1280, 1024) 75.025
"110" "1280x1024@60" QSize(1280, 1024) 60.02
"111" "1440x900@61" QSize(1440, 900) 61
"112" "1280x800@60" QSize(1280, 800) 59.81
"113" "1280x720@60" QSize(1280, 720) 60
"114" "1280x720@60" QSize(1280, 720) 60
"115" "1280x720@60" QSize(1280, 720) 59.94
"116" "1280x720@50" QSize(1280, 720) 50
"117" "1024x768@75" QSize(1024, 768) 75.029
"118" "1024x768@60" QSize(1024, 768) 60.004
"119" "800x600@75" QSize(800, 600) 75
"120" "800x600@60" QSize(800, 600) 60.317
"121" "720x576@50" QSize(720, 576) 50
"122" "720x576@50" QSize(720, 576) 50
"123" "720x480@60" QSize(720, 480) 60
"124" "720x480@60" QSize(720, 480) 60
"125" "720x480@60" QSize(720, 480) 59.94
"126" "720x480@60" QSize(720, 480) 59.94
"127" "720x480@60" QSize(720, 480) 59.94
"128" "640x480@73" QSize(640, 480) 72.809
"129" "640x480@67" QSize(640, 480) 66.667
"130" "640x480@60" QSize(640, 480) 60
"131" "640x480@60" QSize(640, 480) 59.94
"132" "640x480@60" QSize(640, 480) 59.94
"133" "720x400@70" QSize(720, 400) 70.082
"134" "1600x1200@60" QSize(1600, 1200) 59.869
"135" "1280x1024@60" QSize(1280, 1024) 59.895
"136" "1024x768@60" QSize(1024, 768) 59.92
"137" "2560x1600@60" QSize(2560, 1600) 59.987
"138" "1920x1200@60" QSize(1920, 1200) 59.885
"139" "3840x2160@60" QSize(3840, 2160) 59.981
"140" "3200x1800@60" QSize(3200, 1800) 59.956
"141" "2880x1620@60" QSize(2880, 1620) 59.96
"142" "2560x1440@60" QSize(2560, 1440) 59.961
"143" "1920x1080@60" QSize(1920, 1080) 59.963
"144" "1600x900@60" QSize(1600, 900) 59.946
"145" "1368x768@60" QSize(1368, 768) 59.882
"146" "1280x720@60" QSize(1280, 720) 59.855
"95" "3840x2160@61" QSize(3840, 2160) 61
"96" "4096x2160@60" QSize(4096, 2160) 60
"97" "4096x2160@60" QSize(4096, 2160) 59.94
"98" "4096x2160@50" QSize(4096, 2160) 50
"99" "3840x2160@30" QSize(3840, 2160) 30
EDID Info:
Device ID: "xrandr-UHD DP-21573"
Name: "UHD DP"
Vendor: ""
Serial: "21573"
EISA ID: ""
Hash: "8b2068e216244305ffd30aa0fd707486"
Width: 70
Height: 40
Gamma: 2.2
Red: QQuaternion(scalar:1, vector:(0.657227, 0.328125, 0))
Green: QQuaternion(scalar:1, vector:(0.301758, 0.623047, 0))
Blue: QQuaternion(scalar:1, vector:(0.146484, 0.0556641, 0))
White: QQuaternion(scalar:1, vector:(0.3125, 0.328125, 0))
-----------------------------------------------------
Id: 4
Name: "HDMI-A-1"
Type: "HDMI"
Connected: true
Enabled: false
Priority: 0
Rotation: KScreen::Output::None
Pos: QPoint(4369,-846)
MMSize: QSize(1872, 1053)
FollowPreferredMode: false
Size: QSize(3840, 2160)
Scale: 2
Clones: None
Mode: "147"
Preferred Mode: "147"
Preferred modes: QList("147")
Modes:
"147" "3840x2160@60" QSize(3840, 2160) 60
"148" "4096x2160@60" QSize(4096, 2160) 60
"149" "4096x2160@60" QSize(4096, 2160) 59.94
"150" "4096x2160@50" QSize(4096, 2160) 50
"151" "4096x2160@24" QSize(4096, 2160) 24
"152" "4096x2160@24" QSize(4096, 2160) 23.976
"153" "3840x2160@60" QSize(3840, 2160) 60
"154" "3840x2160@60" QSize(3840, 2160) 59.94
"155" "3840x2160@50" QSize(3840, 2160) 50
"156" "3840x2160@30" QSize(3840, 2160) 30
"157" "3840x2160@30" QSize(3840, 2160) 29.97
"158" "3840x2160@25" QSize(3840, 2160) 25
"159" "3840x2160@24" QSize(3840, 2160) 24
"160" "3840x2160@24" QSize(3840, 2160) 23.976
"161" "1920x1200@60" QSize(1920, 1200) 60
"162" "1920x1080@120" QSize(1920, 1080) 120
"163" "1920x1080@120" QSize(1920, 1080) 119.88
"164" "1920x1080@100" QSize(1920, 1080) 100
"165" "1920x1080@60" QSize(1920, 1080) 60
"166" "1920x1080@60" QSize(1920, 1080) 60
"167" "1920x1080@60" QSize(1920, 1080) 59.94
"168" "1920x1080@50" QSize(1920, 1080) 50
"169" "1920x1080@30" QSize(1920, 1080) 30
"170" "1920x1080@30" QSize(1920, 1080) 29.97
"171" "1920x1080@24" QSize(1920, 1080) 24
"172" "1920x1080@24" QSize(1920, 1080) 23.976
"173" "1600x1200@60" QSize(1600, 1200) 60
"174" "1680x1050@60" QSize(1680, 1050) 60
"175" "1280x1024@60" QSize(1280, 1024) 60.02
"176" "1440x900@60" QSize(1440, 900) 59.901
"177" "1280x800@60" QSize(1280, 800) 60
"178" "1280x720@60" QSize(1280, 720) 60
"179" "1280x720@60" QSize(1280, 720) 59.94
"180" "1280x720@50" QSize(1280, 720) 50
"181" "1024x768@60" QSize(1024, 768) 60.004
"182" "800x600@60" QSize(800, 600) 60.317
"183" "720x576@50" QSize(720, 576) 50
"184" "720x480@60" QSize(720, 480) 60
"185" "720x480@60" QSize(720, 480) 60
"186" "720x480@60" QSize(720, 480) 59.94
"187" "720x480@60" QSize(720, 480) 59.94
"188" "640x480@60" QSize(640, 480) 60
"189" "640x480@60" QSize(640, 480) 59.94
"190" "640x480@60" QSize(640, 480) 59.94
"191" "1600x1200@60" QSize(1600, 1200) 59.869
"192" "1280x1024@60" QSize(1280, 1024) 59.895
"193" "1024x768@60" QSize(1024, 768) 59.92
"194" "2560x1600@60" QSize(2560, 1600) 59.987
"195" "1920x1200@60" QSize(1920, 1200) 59.885
"196" "1280x800@60" QSize(1280, 800) 59.81
"197" "3840x2160@60" QSize(3840, 2160) 59.981
"198" "3200x1800@60" QSize(3200, 1800) 59.956
"199" "2880x1620@60" QSize(2880, 1620) 59.96
"200" "2560x1440@60" QSize(2560, 1440) 59.961
"201" "1920x1080@60" QSize(1920, 1080) 59.963
"202" "1600x900@60" QSize(1600, 900) 59.946
"203" "1368x768@60" QSize(1368, 768) 59.882
"204" "1280x720@60" QSize(1280, 720) 59.855
EDID Info:
Device ID: "xrandr-Mega System Technologies Inc-MEC-O-3-H-1"
Name: "MEC-O-3-H"
Vendor: "Mega System Technologies Inc"
Serial: "1"
EISA ID: ""
Hash: "651e568269c5e114f7e5d6bcce53333a"
Width: 115
Height: 65
Gamma: 2.2
Red: QQuaternion(scalar:1, vector:(0.639648, 0.339844, 0))
Green: QQuaternion(scalar:1, vector:(0.299805, 0.69043, 0))
Blue: QQuaternion(scalar:1, vector:(0.137695, 0.0380859, 0))
White: QQuaternion(scalar:1, vector:(0.282227, 0.296875, 0))
I can't personally reproduce, but marking as "confirmed" based on the number of different reports detailing this issue. Thanks! I also can reproduce this - I have three screens - two with the same resolution (2560x1440) and scaling 150%, and a laptop screen in the middle (2256x1504) with 175% scaling. One additional detail - the two external screens are daisy-chained and one of them is always projected on one of the other two, depending on how they are ordered. (In reply to Kamen from comment #23) > I also can reproduce this - I have three screens - two with the same > resolution (2560x1440) and scaling 150%, and a laptop screen in the middle > (2256x1504) with 175% scaling. One additional detail - the two external > screens are daisy-chained and one of them is always projected on one of the > other two, depending on how they are ordered. With some more testing - seems it is always the second one in the daisy-chain that can't be region selected. I can't reproduce the original video showcase with two screens horizontally next to each other, but I can reproduce the screenshot showcase with two screens centered at the middle. (In reply to Jonas Ryssel from comment #18) > I have a strong suspicion that sometimes KWin and Spectacle disagree on the > resolution of displays when using fractional scaling. That could be the case. I was recently told by KWin a developer that it's actually impossible to properly get the device pixel ratio on Wayland using Qt or KDE APIs. Most of the time QScreen::devicePixelRatio is good enough, but there are edge cases. > With my setup (where the bug is present) `the display is set to 2560x2880 > with 150% scaling. > If I take a full screen screenshot using the "current screen" option in > spectacle, the resolution is 2561x1440. > This suggests that spectacle (or QT or something else) thinks that the > display is 1 pixel wider than what KWin thinks, and if I then place that > display to the left, the displays will overlap by 1 pixel, causing the issue. The screenshot for this case actually comes directly from KWin's screenshot plugin without modification, so I'm not totally sure what's going on there. I think 2560 is likely being divided by 1.5 somewhere (1706.67) and rounded (1707), then multiplied by 1.5 by Spectacle (2560.5) and rounded again (2561). Unfortunately there's not a lot that can be done about that since screen and window sizes are defined in logical coordinates (physical pixel size divided by DPR) as integers. Qt's QScreen and QWindow classes use integers for sizes and positions, but Wayland itself even uses integers for sizes and positions in logical coordinates. This means some precision is guaranteed to be lost. > ---- My (unqualified) guess on what causes the issue / what to look for in > the code ---- > I think there are two bugs which would fix this issue, and I don't know > which one is easier to fix (probably nr. 1). > > 1. There is a math issue somewhere in the code (duh!). > In my tests the issue only seems to be present when `resolution/scaling > factor` calculation results in the fractional part being above .5 (i.e. it > would be rounded up), which suggests a rounding error... I have however also > found a case where the faction is above .5 and the bug isn't present, so it > is only a hunch. > I guess this relates to how "weird" resolutions causes the issue. I have > another PC setup where I couldn't reproduce the issue, but once I switched > to a 1368x768 resolution, it became much easier to reproduce it without > purposefully overlapping the displays. > > 2. If you have overlapping displays, Spectacle seemingly takes your mouse > offset relative to the top left corner of one display, then selects an area > with the same offset but relative to the other display's top left corner. > > Sorry for rambling ;) Number 2 is probably what I'll end up having to do. I don't mind ramblers who are helping :) It turns out this is a lot more complicated and depends on more parts outside of Spectacle than I thought. I get a feeling this won't be fixed in time for 6.4 unless a lot of special effort is made at different levels of the stack. Which is a good opportunity to introduce some basic editing tools to Spectacle, like crop :) Jonas, your issue involves overlapping screens, unlike most other people encountering the bug. This makes it something different, which would need a separate bug report. However overlapping screens like that are not really supported; I'd strongly recommend using a different arrangement, as you'll find a million weird random-feeling bugs everywhere. Also, in a future Plasma version, arrangements like this will be disallowed. For people who have been able to reproduce this issue (the original issue, not the new one reported by Jonas which involves overlapping screens), are you still seeing it happen with Qt 6.9? We're having a great deal of trouble reproducing it on our Qt 6.9 dev systems, and suspect it may already be fixed. If anyone can still reproduce this issue in Qt 6.9, please let us know. Thanks a lot, folks! (In reply to Noah Davis from comment #26) > The screenshot for this case actually comes directly from KWin's screenshot plugin > without modification, so I'm not totally sure what's going on there. I think 2560 is > likely being divided by 1.5 somewhere (1706.67) and rounded (1707), then multiplied > by 1.5 by Spectacle (2560.5) and rounded again (2561). Unfortunately there's not a > lot that can be done about that since screen and window sizes are defined in logical > coordinates (physical pixel size divided by DPR) as integers. Qt's QScreen and > QWindow classes use integers for sizes and positions, but Wayland itself even uses > integers for sizes and positions in logical coordinates. This means some precision is > guaranteed to be lost. It doesn't seem like you can solve the issue by fixing the math, but just to prevent double work/research: I already tried reproducing the bug on various scaling factors, writing down which caused the issue, then trying to recreate the formula using all combinations of ceil, floor, round, *2, /2, /scaling_factor up to a depth of five (e.g. `floor(round((width*2)/scaling_factor)/2)`). I wasn't able to make a formula with a +1 pixel error on exactly all the monitor resolutions and scaling factors where the issue occurs. So I think the formula might be way more complicated that just rounding once or twice. (In reply to Nate Graham from comment #29) > Jonas, your issue involves overlapping screens, unlike most other people > encountering the bug. This makes it something different, which would need a > separate bug report. Just to clarify: My day-to-day monitor setup doesn't (purposefully) include overlapping monitors. I simply observed that the screenshot of my leftmost monitor was 1 pixel wider that what the resolution of the monitor supposedly was, which could potentially point at the monitors somehow accidentally overlapping by one pixel. Since most of you had issues reproducing the bug, purposefully overlapping the monitors was only to see if I could forcefully reproduce with any setup and if it would act in the same way as the bug this issue is tackling (which could also be useful for testing a fix). The fact that it does, suggests that my theory of the monitors overlapping with one pixel is correct. (In reply to Nate Graham from comment #30) > If anyone can still reproduce this issue in Qt 6.9, please let us know. Under the assumption that my issue is indeed the same as everyone else, I still have the issue on KDE Plasma 6.3.5 KDE Frameworks 6.14.0 Qt 6.9.0. If you think that my issue is still a different bug, even after reading what I wrote in comment #31 (i.e. that my monitors are not actually overlapping. The output of `kscreen-doctor -o` is Left monitor: Geometry: 0,0 1707x1920 Right monitor: Geometry: 1707,341 2560x1440 ) , then I'll create a new bug. I just think you misunderstood what I meant. Ok yeah, sounds like it. Re-opening. (In reply to Nate Graham from comment #30) > If anyone can still reproduce this issue in Qt 6.9, please let us know. > Thanks a lot, folks! I can still reproduce it using the steps in Bug 500555. It is highly resolution specific and placement of the monitor makes a difference too. Operating System: Fedora Linux 42 KDE Plasma Version: 6.3.5 KDE Frameworks Version: 6.14.0 Qt Version: 6.9.0 A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/459 Git commit f407154111eb6fd3f8c0cc3d80eb3e6c0a241be7 by Noah Davis. Committed on 30/05/2025 at 02:49. Pushed by ndavis into branch 'master'. Workaround QWindow::screen being wrong with some fractional DPR screen layout combinations Caused the selection editor to select on the wrong screen. M +5 -0 src/Gui/CaptureWindow.cpp https://invent.kde.org/graphics/spectacle/-/commit/f407154111eb6fd3f8c0cc3d80eb3e6c0a241be7 Git commit 64e46b80e621e48f6e7fc9eff555c320d327457b by Noah Davis. Committed on 30/05/2025 at 19:13. Pushed by ndavis into branch 'Plasma/6.4'. Workaround QWindow::screen being wrong with some fractional DPR screen layout combinations Caused the selection editor to select on the wrong screen. (cherry picked from commit f407154111eb6fd3f8c0cc3d80eb3e6c0a241be7) Co-authored-by: Noah Davis <noahadvs@gmail.com> M +5 -0 src/Gui/CaptureWindow.cpp https://invent.kde.org/graphics/spectacle/-/commit/64e46b80e621e48f6e7fc9eff555c320d327457b (In reply to Noah Davis from comment #37) > Git commit 64e46b80e621e48f6e7fc9eff555c320d327457b by Noah Davis. > Committed on 30/05/2025 at 19:13. > Pushed by ndavis into branch 'Plasma/6.4'. I just compiled it and can confirm that the bug has been fixed. A huge thank you from me <3 I still seem to be on qtbase 6.8 and spectacle 6.3.5, yet my problem has been resolved. Given that I'm not sure if I actually got the workaround on my system or not, I'm replying. Here is my information Plasma: 6.3.5 KDE Frameworks: 6.14.0 Qt Version: 6.8.3 Wayland version: 1.23.1 As the "version fixed in" field says, this is fixed in version 6.4.0. *** Bug 505548 has been marked as a duplicate of this bug. *** Just to confirm new 6.4 spectacle release on arch solved issue for me. Thanks everyone |