Bug 430415 - Global scale breaks Rectangular Region capture
Summary: Global scale breaks Rectangular Region capture
Status: RESOLVED WORKSFORME
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 20.12.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-12-15 11:56 UTC by Frederick Zhang
Modified: 2021-06-10 14:10 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederick Zhang 2020-12-15 11:56:26 UTC
SUMMARY
I've set Global Scale to 2. After upgrading from 20.08.3 to 20.12.0, now when I try to capture a rectangular region, my whole desktop goes black with only the + mouse cursor showing and I cannot move it.

STEPS TO REPRODUCE
1. Launch Spectacle
2. Capture a rectangular region

OBSERVED RESULT
Black screen. I can still hit ESC to interrupt the capture.

If I run Spectacle via command line, an error message can be seen:
$ spectacle --region --nonotify
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap

There was no such an error message when I was using Spectacle 20.08.3.

My global scale is set 2 and Plasma sets QT_SCREEN_SCALE_FACTORS automatically. The issue is gone if I unset the environment variable and try the command above again:
$ echo $QT_SCREEN_SCALE_FACTORS
HDMI-0=2;DP-0=2;DP-1=2;DP-2=2;DP-3=2;DP-4=2;
$ /usr/bin/env QT_SCREEN_SCALE_FACTORS='' spectacle --region --nonotify

For now I've rolled Spectacle only back to 20.08.3 and it's working normally atm.

EXPECTED RESULT
Normally captures a rectangular region.


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Kernel Version: 5.9.14-zen1-1-zen
OS Type: 64-bit
Comment 1 Nate Graham 2020-12-16 21:51:06 UTC
Works for me with 200% scale FWIW.
Comment 2 Adomas Jackevičius 2020-12-16 23:59:53 UTC
For me everything works, but since the latest version it got very slow and GPU intesive. Got same output in command line:

$ spectacle --region --nonotify
QPixmap::scaled: Pixmap is a null pixmap

I use Global Scale set to 2:

$ echo $QT_SCREEN_SCALE_FACTORS
DP-0=2;DP-1=2;HDMI-0=2;DP-2=2;DP-3=2;HDMI-1=2;DP-4=2;DP-5=2;

I think my issue might be related. I have NVIDIA GPU with binary nvidia drivers.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Kernel Version: 5.9.14-arch1-1
OS Type: 64-bit
Comment 3 Frederick Zhang 2020-12-17 11:59:36 UTC
Welp, it seems to be related to my weird display setup again... and probably nvidia lol (I'll definitely get an AMD next time sigh)

I've got 3 displays: DP-0 1080p on the left, DP-3 4K in the middle (primary) and DP-1 1080p on the right. And my Xsetup command is:

xrandr --fb 11520x2160 \
        --output "$LEFT"   --auto           --scale 2.0 --dpi 256 --panning 3840x2160+0+0    --pos 0x0    \
        --output "$MIDDLE" --auto --primary --scale 1.0 --dpi 163 --panning 3840x2160+3840+0 --pos 3840x0 \
        --output "$RIGHT"  --auto           --scale 2.0 --dpi 205 --panning 3840x2160+7680+0 --pos 7680x0

And so far this is the only configuration that I can use to reproduce this problem.


I've tried:

1. All 3 displays on, X scale all set to 1.0
2. Left and Middle on, Left scale set to 2.0
3. Left and Middle on, Left scale set to 1.0
4. Right and Middle on, Left scale set to 2.0
5. Right and Middle on, Left scale set to 1.0

...and Spectacle rectangular region capturing worked just normally.

Is it possible that this issue is only reproducible when X framebuffer is large enough?
Comment 4 Frederick Zhang 2021-06-10 14:10:16 UTC
Using 21.04.2 I don't have this issue any more.