Bug 470023 - QT_SCREEN_SCALE_FACTORS causes spectacle to mess up rendering the captured buffers for the selection tool.
Summary: QT_SCREEN_SCALE_FACTORS causes spectacle to mess up rendering the captured bu...
Status: RESOLVED NOT A BUG
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 23.04.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-19 21:43 UTC by randamunanamae
Modified: 2023-09-30 19:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description randamunanamae 2023-05-19 21:43:49 UTC
Using the environment variable `QT_SCREEN_SCALE_FACTORS` to properly inform qt of the different DPI of each screen causes Spectacle to overlap the images it captures for the selection tool, furthermore the region selected doesn't even match what is shown.

STEPS TO REPRODUCE
1. Launch spectacle with environment variable `QT_SCREEN_SCALE_FACTORS` using different scale factors for each monitor
2. Try to take a screenshot

OBSERVED RESULT
Buffers captured for each screen are rendered at a scaled DPI (presumably from the main monitor) causing overlapping when showing them and inability to select intended region.

EXPECTED RESULT
Same behavior as if no such scale factors are in use.
Comment 1 Noah Davis 2023-05-19 22:30:24 UTC
Are you using X11 or Wayland?
Comment 2 Noah Davis 2023-05-20 16:41:27 UTC
FWIW, I'm not sure if using `QT_SCREEN_SCALE_FACTORS` in this way is supported on X11 since we only support one scale factor for all screens on X11. On Wayland, you can just use system settings to set a scale factor for each screen. Downgrading severity to normal for now since the workaround is to not use the environment variable (see https://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Bug_triaging#Severity).
Comment 3 randamunanamae 2023-05-21 16:24:00 UTC
(In reply to Noah Davis from comment #2)
> FWIW, I'm not sure if using `QT_SCREEN_SCALE_FACTORS` in this way is
> supported on X11 since we only support one scale factor for all screens on
> X11. On Wayland, you can just use system settings to set a scale factor for
> each screen. Downgrading severity to normal for now since the workaround is
> to not use the environment variable (see
> https://community.kde.org/index.php?title=Guidelines_and_HOWTOs/
> Bug_triaging#Severity).

I'm on X11, since I could never get wayland+kde to work on an nvidia laptop.

Before the redesign of spectacle, it used to leave a deamon running, so I would kill it and launch it with different env variables and then the shortcuts would work as expected; now, after the redesign, it no longer uses a deamon so my work around doesn't work anymore since you can never override the "standard shortcuts" launchers (or at least I couldn't find how).
I agree with the downgrading of the severity, I set it high because it makes it unusable for me but you are right.
I guess as a final workaround, I'm going to disable all spectacle shortcuts, and then manually create new ones with custom launchers.

On the technical side, I don't even know if you can really fix this unless you create one window per screen when displaying the region selecting tool, and then do a complicated dance regarding window focus, mouse presses and releases, and cursor position; because doing single window that spans all screens seems even more complicated given the different DPI of each one and the designed DPI of the window.
Comment 4 Nate Graham 2023-05-22 20:07:30 UTC
> FWIW, I'm not sure if using `QT_SCREEN_SCALE_FACTORS` in this way is supported on X11

Indeed it is not. I'm afraid KDE software is not designed to be used in this way, and as such, it's not something we can offer support for, sorry.