Bug 462860 - Rectangle capture modes have wrong GUI sizing and positioning with fractional scaling
Summary: Rectangle capture modes have wrong GUI sizing and positioning with fractional...
Status: REOPENED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 23.03.80
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 467855 468785 468912 469021 469262 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-12-10 17:39 UTC by ryu.ketsueki
Modified: 2023-05-16 19:56 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.04.1


Attachments
The actual effect (363.82 KB, image/jpeg)
2022-12-10 17:39 UTC, ryu.ketsueki
Details
A photo showing what is happening (547.75 KB, image/jpeg)
2023-01-20 15:39 UTC, ryu.ketsueki
Details
Spectacle scaling problem 800x600 at 150% (740.78 KB, image/jpeg)
2023-05-16 16:45 UTC, Hexagon
Details
800x600@150%, 3840x2160@200% for ndavis (2.24 MB, image/jpeg)
2023-05-16 17:03 UTC, Noah Davis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ryu.ketsueki 2022-12-10 17:39:16 UTC
Created attachment 154483 [details]
The actual effect

Is a bit hard to describe accurately so I am attaching a photo I took with my phone. To reproduce this, you have to be on Wayland session, although I think it also happens with certain X11 workarounds to achieve a similar effect. To do that, you change the scaling factor away from 100%. In my case, it is on 70%.

From what I understood here, the actual desktop is under that "photo" and you can actually snap a retangular region there and will be accurate, meaning that the smaller photo is only a bit misleading in this context. The way I expect this to be is that this small photo actually takes the whole screen instead of only part of it
Comment 1 Nate Graham 2023-01-03 20:48:56 UTC
Spectacle was largely rewritten for the 23.04 release, so the code governing this has changes sufficiently that it's possible the issue has been fixed, or worsened.

I can't reproduce the issue with a multimonitor multi-scale setup on Wayland, so it does seem to be fixed, hopefully. Feel free to re-open this bug report if you find that it's not fixed for you once you upgrade to the 23.04 version in a few months.
Comment 2 ryu.ketsueki 2023-01-06 17:27:30 UTC
This happened with the rewrite. It was actually after I read about the rewrite that I wanted to test it. I would have replied if it still happens on my end but spectacle is crashing on my end and I can't get a backtrace for some reson. DrKonqi doesn't launch with the crash and trying to backtrace with gdb also doesn't return anything. Guess I'll have to wait until the next KDE Gear is released
Comment 3 ryu.ketsueki 2023-01-20 15:39:04 UTC
Created attachment 155457 [details]
A photo showing what is happening

I can confirm it is still happening in my case and it is the rewrite. Granted, it is the KDE Unstable Repos for Tumbleweed so I didn't compile it myself but the package version is as follows:

22.11.70git.20230119T021936~7d04f7c-ku.38.1

I think that means it was compiled and packaged yesterday (January 19th, 2023) with the 7d04f7c commit (I think). Same result as before.
Comment 4 Nate Graham 2023-01-20 21:55:56 UTC
OK, thanks!
Comment 5 ryu.ketsueki 2023-04-09 21:15:11 UTC
Has there been any progress in figuring out or fixing this? I'm on the version 23.03.90 of Spectacle through KDE Repos for openSUSE and situation looks exactly the same?
Comment 6 Noah Davis 2023-04-11 14:55:01 UTC
(In reply to ryu.ketsueki from comment #5)
> Has there been any progress in figuring out or fixing this? I'm on the
> version 23.03.90 of Spectacle through KDE Repos for openSUSE and situation
> looks exactly the same?

I couldn't reproduce this.
Comment 7 Noah Davis 2023-04-11 14:56:08 UTC
I tried to test this on a setup using 2 monitors. One 1920x1080@1x screen, one 3840x2160@2x screen.
Comment 8 ryu.ketsueki 2023-04-11 19:37:05 UTC
(In reply to Noah Davis from comment #7)
> I tried to test this on a setup using 2 monitors. One 1920x1080@1x screen,
> one 3840x2160@2x screen.

Try setting to 70% on Wayland. It's my current setting
Comment 9 Noah Davis 2023-04-11 22:28:24 UTC
(In reply to ryu.ketsueki from comment #8)
> (In reply to Noah Davis from comment #7)
> > I tried to test this on a setup using 2 monitors. One 1920x1080@1x screen,
> > one 3840x2160@2x screen.
> 
> Try setting to 70% on Wayland. It's my current setting

OK, it seem that the fractional scale factors are the cause, not the screen layout.
Comment 10 Noah Davis 2023-04-11 22:34:39 UTC
(In reply to Noah Davis from comment #9)
> OK, it seem that the fractional scale factors are the cause, not the screen
> layout.

Also not scaling different from 100% in general. Integer scale factors work fine.
Comment 11 Noah Davis 2023-04-11 22:38:52 UTC
*** Bug 467855 has been marked as a duplicate of this bug. ***
Comment 12 ryu.ketsueki 2023-04-13 12:52:55 UTC
(In reply to Noah Davis from comment #9)
> OK, it seem that the fractional scale factors are the cause, not the screen
> layout.

That makes sense. I use KWin Wayland fractional scaling on my laptop because the elements are too big on a 1366x768 resolution display. It's one of the reasons I moved away from X11. Hopefully this can be fixed before next release
Comment 13 Alexander Yavorsky 2023-04-17 11:39:47 UTC
Faced the same issue: X window system and two monitors with fractional (125%) scale.
Comment 14 Noah Davis 2023-04-17 11:45:09 UTC
This should be fixed in commit a85343658e25cc64d09d00b485c5855be9c7c57a now, which should be in the 23.04 release version.
Comment 15 Noah Davis 2023-04-17 11:51:50 UTC
Actually, I just remembered it's only partly fixed. I may have mistakenly thought 2 separate issues were one.

This issue: There is a smaller image overlaid on top of the real image that shouldn't be there.

The other issue that was actually fixed: Exports from multi-monitor setups with scaling had weird gaps between screens and wrong selected areas.
Comment 16 Noah Davis 2023-04-17 11:56:12 UTC
(In reply to Noah Davis from comment #15)
> This issue: There is a smaller image overlaid on top of the real image that
> shouldn't be there.

I think I need to wake up. I misspoke, It's actually that the image isn't sized/positioned correctly, as Ryu and I said previously.
Comment 17 Bug Janitor Service 2023-04-17 12:17:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/228
Comment 18 Noah Davis 2023-04-17 13:50:03 UTC
Git commit d0886c85445fad227b256152a549cb33bd97b776 by Noah Davis.
Committed on 17/04/2023 at 12:18.
Pushed by ndavis into branch 'master'.

Fix wrong image position in rectangle capture mode with scaling

M  +1    -1    src/Gui/Annotations/AnnotationDocument.cpp

https://invent.kde.org/graphics/spectacle/commit/d0886c85445fad227b256152a549cb33bd97b776
Comment 19 Noah Davis 2023-04-21 23:46:16 UTC
*** Bug 468785 has been marked as a duplicate of this bug. ***
Comment 20 Noah Davis 2023-04-24 16:53:47 UTC
*** Bug 468912 has been marked as a duplicate of this bug. ***
Comment 21 ryu.ketsueki 2023-04-24 20:29:43 UTC
Yeah, this fix didn't come with 23.04.0, apparently. But I also couldn't test the fix itself to see if it is truly fixed on my end.
Comment 22 Nate Graham 2023-04-25 15:35:34 UTC
Right, the "Version fixed in" field says "23.04.1"
Comment 23 Noah Davis 2023-04-26 18:13:37 UTC
*** Bug 469021 has been marked as a duplicate of this bug. ***
Comment 24 Noah Davis 2023-05-02 15:15:54 UTC
*** Bug 469262 has been marked as a duplicate of this bug. ***
Comment 25 Hexagon 2023-05-11 20:16:55 UTC
Thanks for the fix. Unfortunately the fix seems to not work for my monitor configuration. In my case the problem is still identical.
- I am using spectacle 23.04.1-1 from the Archlinux repository. 
- My left monitor is 2560x1440px with a scaling factor of 150%
- My center monitor is 3840x2160px with a scaling factor of 200%
- The artifact can be seen on the center monitor as screenshotted in a duplicate bug report of me: https://bugs.kde.org/show_bug.cgi?id=468912
Comment 26 indecisiveautomator 2023-05-11 20:45:26 UTC
The issue is also still affecting me with Spectacle 23.04.1.

My left-most display is 150% scaled, my other three displays are all unscaled 1080p displays. The issue I am experiencing is slightly different to the attachment on this issue, Bug 468785 has a screenshot (horizontal alignment is correct but vertical alignment is not).

In my case as well, I have my displays with three along the bottom and one at the top in the center. This has caused numerous issues with Plasma (pretty much all of which have since been fixed fwiw) so I am mentioning it in case this may also be relevant.
Comment 27 ryu.ketsueki 2023-05-12 13:03:03 UTC
(In reply to indecisiveautomator from comment #26)
> The issue is also still affecting me with Spectacle 23.04.1.
> 
> My left-most display is 150% scaled, my other three displays are all
> unscaled 1080p displays. The issue I am experiencing is slightly different
> to the attachment on this issue, Bug 468785 has a screenshot (horizontal
> alignment is correct but vertical alignment is not).
> 
> In my case as well, I have my displays with three along the bottom and one
> at the top in the center. This has caused numerous issues with Plasma
> (pretty much all of which have since been fixed fwiw) so I am mentioning it
> in case this may also be relevant.

Can confirm. Issue still occurs with me. Just updated to 23.04.1 and the problem still remains.
Comment 28 Noah Davis 2023-05-16 04:26:27 UTC
(In reply to Hexagon from comment #25)
> Thanks for the fix. Unfortunately the fix seems to not work for my monitor
> configuration. In my case the problem is still identical.
> - I am using spectacle 23.04.1-1 from the Archlinux repository. 
> - My left monitor is 2560x1440px with a scaling factor of 150%
> - My center monitor is 3840x2160px with a scaling factor of 200%
> - The artifact can be seen on the center monitor as screenshotted in a
> duplicate bug report of me: https://bugs.kde.org/show_bug.cgi?id=468912

I can't test your exact configuration since one of my screens only goes up to 1920x1080. Can you try setting the left screen to 1920x1080 at 150%? I was unable to reproduce the bug using 1920x1080 at 150% and 3840x2160 at 200%.
Comment 29 ryu.ketsueki 2023-05-16 09:36:42 UTC
(In reply to Noah Davis from comment #28)
> I can't test your exact configuration since one of my screens only goes up
> to 1920x1080. Can you try setting the left screen to 1920x1080 at 150%? I
> was unable to reproduce the bug using 1920x1080 at 150% and 3840x2160 at
> 200%.

By the way, scaling up is not the only thing that causes this bug. Scaling down also does it, at least for my case. The way I did it was that I have a 1366x768 display on my laptop. It's the max resolution possible with it. Things look too large here so I set the scaling to 70%. It works and the elements are smaller. In fact, they look closer to how they would be if this were a 1920x1080 display. But then I get that Spectacle bug.

Also no NVIDIA graphics here either. It's only an Intel UHD Graphics 620.
Comment 30 Hexagon 2023-05-16 14:49:59 UTC
(In reply to Noah Davis from comment #28)
> (In reply to Hexagon from comment #25)
> > Thanks for the fix. Unfortunately the fix seems to not work for my monitor
> > configuration. In my case the problem is still identical.
> > - I am using spectacle 23.04.1-1 from the Archlinux repository. 
> > - My left monitor is 2560x1440px with a scaling factor of 150%
> > - My center monitor is 3840x2160px with a scaling factor of 200%
> > - The artifact can be seen on the center monitor as screenshotted in a
> > duplicate bug report of me: https://bugs.kde.org/show_bug.cgi?id=468912
> 
> I can't test your exact configuration since one of my screens only goes up
> to 1920x1080. Can you try setting the left screen to 1920x1080 at 150%? I
> was unable to reproduce the bug using 1920x1080 at 150% and 3840x2160 at
> 200%.

Unfortunately Plasma does not let me set my monitor to 1920x1080. Although xrandr lists it as a supported option. On Windows I can set the monitor to 1920x1080. There seems to be a EDID problem. But I tried other combinations:

- Middle monitor always 3840x2160 at 200%
- Left monitor at 2560x1440 at 100% --> ok
- Left monitor at 2560x1440 at 125% --> ok
- Left monitor at 2560x1440 at 150%, 175% and 200% --> all of them problematic
- Left monitor at 1280x720 at 100%, 125%, 150%, 175% and 200% --> all of them problematic
- Left monitor at 800x600 at 100%, 125%, 150%, 175% and 200% --> all of them problematic
- Left monitor at 640x480 at 100%, 125%, 150%, 175% and 200% --> all of them problematic

So right now it seems almost all combinations are broken and only some are working.
Comment 31 Noah Davis 2023-05-16 16:32:19 UTC
(In reply to Hexagon from comment #30)
> (In reply to Noah Davis from comment #28)
> > (In reply to Hexagon from comment #25)
> > > Thanks for the fix. Unfortunately the fix seems to not work for my monitor
> > > configuration. In my case the problem is still identical.
> > > - I am using spectacle 23.04.1-1 from the Archlinux repository. 
> > > - My left monitor is 2560x1440px with a scaling factor of 150%
> > > - My center monitor is 3840x2160px with a scaling factor of 200%
> > > - The artifact can be seen on the center monitor as screenshotted in a
> > > duplicate bug report of me: https://bugs.kde.org/show_bug.cgi?id=468912
> > 
> > I can't test your exact configuration since one of my screens only goes up
> > to 1920x1080. Can you try setting the left screen to 1920x1080 at 150%? I
> > was unable to reproduce the bug using 1920x1080 at 150% and 3840x2160 at
> > 200%.
> 
> Unfortunately Plasma does not let me set my monitor to 1920x1080. Although
> xrandr lists it as a supported option. On Windows I can set the monitor to
> 1920x1080. There seems to be a EDID problem. But I tried other combinations:
> 
> - Middle monitor always 3840x2160 at 200%
> - Left monitor at 2560x1440 at 100% --> ok
> - Left monitor at 2560x1440 at 125% --> ok
> - Left monitor at 2560x1440 at 150%, 175% and 200% --> all of them
> problematic
> - Left monitor at 1280x720 at 100%, 125%, 150%, 175% and 200% --> all of
> them problematic
> - Left monitor at 800x600 at 100%, 125%, 150%, 175% and 200% --> all of them
> problematic
> - Left monitor at 640x480 at 100%, 125%, 150%, 175% and 200% --> all of them
> problematic
> 
> So right now it seems almost all combinations are broken and only some are
> working.

I was not able to test 1280x720 (screen just went black until the reset timer put the resolution back at the previous setting), but I could not reproduce the bug with 800x600 or 640x480 on my left screen. My right screen was still at 3840x2160 at 200%.
Comment 32 Hexagon 2023-05-16 16:45:10 UTC
Created attachment 159006 [details]
Spectacle scaling problem 800x600 at 150%

I just took this picture. Spectacle version "spectacle 23.04.1-1" in the Arch repository. Left monitor with 800x600 at 150%. Right with 3840x2160 at 200%. As one can see the overlap of the screen differs with different resolutions and scaling factors.
Comment 33 Noah Davis 2023-05-16 17:03:29 UTC
Created attachment 159008 [details]
800x600@150%, 3840x2160@200% for ndavis

This is how the same settings look for me.
Comment 34 Hexagon 2023-05-16 17:39:27 UTC
Hmm. Weird. I have no idea why it is working on your machine. Some more info: I am using an AMD GPU. Connected via Display Port. Using the Mesa driver.
Comment 35 Noah Davis 2023-05-16 19:56:21 UTC
(In reply to Hexagon from comment #34)
> Hmm. Weird. I have no idea why it is working on your machine. Some more
> info: I am using an AMD GPU. Connected via Display Port. Using the Mesa
> driver.

I am also using an AMD GPU (integrated Renoir) with the Mesa driver, but I am using HDMI for the right screen. I don't have a way to test DisplayPort with my laptop.