Commit aafa575e authored by Fabian Vogt's avatar Fabian Vogt

Decide to use the wayland backend by looking at XDG_SESSION_TYPE

Summary:
With plasma-workspace master, QT_QPA_PLATFORM is no longer set,
so spectacle runs with the xcb platform plugin.

Test Plan: Installed, can take screenshots on wayland again.

Reviewers: #spectacle, graesslin

Differential Revision: https://phabricator.kde.org/D11655
parent 47312df6
......@@ -59,14 +59,17 @@ SpectacleCore::SpectacleCore(StartMode startMode, ImageGrabber::GrabMode grabMod
setFilename(saveFileName);
}
// We might be using the XCB platform (with Xwayland) in a wayland session,
// but the X11 grabber won't work in that case. So force the Wayland grabber
// in Wayland sessions.
if (KWindowSystem::isPlatformWayland() || qstrcmp(qgetenv("XDG_SESSION_TYPE"), "wayland") == 0) {
mImageGrabber = new KWinWaylandImageGrabber;
}
#ifdef XCB_FOUND
if (KWindowSystem::isPlatformX11()) {
if (!mImageGrabber && KWindowSystem::isPlatformX11()) {
mImageGrabber = new X11ImageGrabber;
}
#endif
if (!mImageGrabber && KWindowSystem::isPlatformWayland()) {
mImageGrabber = new KWinWaylandImageGrabber;
}
if (!mImageGrabber) {
mImageGrabber = new DummyImageGrabber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment