Bug 404983 - Spectacle cannot take screenshots in QPainter
Summary: Spectacle cannot take screenshots in QPainter
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: git master
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-02 10:49 UTC by etna
Modified: 2021-12-22 11:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland+
mgraesslin: X11-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description etna 2019-03-02 10:49:41 UTC
SUMMARY
When running Plasma Desktop under Wayland with the QPainter compositor (KWIN_COMPOSE=Q), Spectacle cannot take screenshots.

STEPS TO REPRODUCE
1. Boot to the CLI with systemd.unit=multi-user.target
2. Launch Plasma Desktop with XDG_SESSION_TYPE=wayland KWIN_COMPOSE=Q dbun-run-session /usr/bin/startplasmacompositor
3. Launch Spectacle.


OBSERVED RESULT
Spectacle window appears with no screenshot; pressing 'Take a new screenshot' returns nothing. Trying to save results in a 'Cannot save an empty screenshot' error.

EXPECTED RESULT
A screenshot is taken

SOFTWARE/OS VERSIONS
OpenSUSE Leap 15.0
KDE Plasma Version: v5.12.2
KDE Frameworks Version: v5.45.0
Qt Version: v5.9.4

ADDITIONAL INFORMATION
1. Spectacle successfully takes screenshots when the default OpenGL compositor is used under Wayland, but since Nouveau locks up the entire system when Plasma Wayland is launched it has to be done with nouveau.noaccel=1, and LLVMPIPE is completely unusable for daily computing due to how painfully slow it is.
2. When launching Spectacle from the command line under the QPainter compositor and trying to take a screenshot, the following warnings are shown:
- QPixmap::scaled: Pixmap is a null pixmap
- Unexpected wl_surface.enter received for output with id: 11 screen name: "HDMI-A-1-LEN T23i-10/V300NG74" screen model: ""

HDMI-A-1-LEN T23i-10/V300NG74 is the identity Plasma has for my monitor.
Comment 1 Boudhayan Gupta 2019-06-11 23:48:41 UTC
This is an issue with KWin's screenshot plugin, not Spectacle.
Comment 2 Vlad Zahorodnii 2019-06-12 12:04:46 UTC
What kind of screenshot are you taking (fullscreen, window under cursor, etc)?
Comment 3 Martin Flöser 2019-06-12 19:37:11 UTC
ScreenshotEffect doesn't support QPainter:

bool ScreenShotEffect::supported()
{
    return  effects->compositingType() == XRenderCompositing ||
            (effects->isOpenGLCompositing() && GLRenderTarget::supported());
}
Comment 4 Vlad Zahorodnii 2019-06-12 19:40:03 UTC
> ScreenshotEffect doesn't support QPainter:
Heh, I completely forgot about that.