Created attachment 137927 [details] dbus-monitor output SUMMARY Some distro (eg slackware, suse) use a "mixed" wayland session, where both the xcb and the wayland platforms are available. Basically each app can decide to start as pure wayland or inside XWayland using xcb. When spectacle is run in XWayland, it is not able to grab rectangle regions. STEPS TO REPRODUCE 1. run spectacle with the xcb platform inside a wayland session 2. try to grab a rectangular region OBSERVED RESULT The correct wayland platform is loaded by looking at XDG_SESSION_TYPE, but something goes wrong during the screen grab. Console output: Error calling KWin DBus interface: "org.kde.kwin.Screenshot.Error.ScreenMissing" "Screen not found" EXPECTED RESULT A rectangle region grab SOFTWARE/OS VERSIONS Operating System: Slackware 14.2 KDE Plasma Version: 5.21.4 KDE Frameworks Version: 5.81.0 Qt Version: 5.15.2 Kernel Version: 5.12.0 OS Type: 64-bit Graphics Platform: Wayland Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics Memory: 15.0 GiB of RAM Graphics Processor: AMD RENOIR ADDITIONAL INFORMATION I tried the current master version that uses the new PlatformKWinWayland2, but I still get the same error
Sorry, my KWin doesn't provide org.kde.KWin.ScreenShot2 so spectacle/master is still using the old PlatformKWinWayland. It looks like before plasma 5.21 the "ractangular region" grab used "screenshotFullscreen" that doesn't require a screen, while now it uses "screenshotScreens" providing a screen obtained from QGuiApplication::screens(). I suspect the problem is due to QGuiApplication::screens() returning the Xwayland screen instead of the Wayland one.
Fixed in Plasma 5.22, sorry about that. *** This bug has been marked as a duplicate of bug 432260 ***
I'm now running spectacle 21.04.2 on plasma 5.22, and the bug is still present. I saw the introduction of the new PlatformKWinWayland2 interface but it still uses QGuiApplication::screens() to get the screen name used in the dbus request to KWin. When running spectacle in a mixed wayland/xwayland session (as used by suse and slackware), spectacle will default using the xcb backend. This means that QGuiApplication::screens() will return the dummy XWayland screen, while KWin expects to get a request for a Wayland screen name. This obviously fails. My current workaround just comments out QGuiApplication::screens() and hardcodes my laptop screen name QStringLiteral("eDP-1"), but that's obviously a dirty hack. I found no way from a qt app running inside xwayland to get the wayland screen names. I can see a few possible solutions to this problem: * let kwin enumerate the available screens somewhere in its dbus interface for spectacle to pick it up * always force spectacle to use the wayland backend if available
Can you still reproduce it on some newer Plasma version (5.25+)?
Yes, the bug is still present. Spectacle is not able to grab a rectangular area screenshot under XWayland. To be honest I switched to using a full wayland session (without xwayland) just to avoid this bug, so it doesn't affect me anymore. Operating System: Slackware 15.0 (current) KDE Plasma Version: 5.25.3 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.4 Kernel Version: 5.18.11 (64-bit) Graphics Platform: Wayland Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics Memory: 15.0 GiB of RAM Graphics Processor: AMD RENOIR Manufacturer: HP Product Name: HP ProBook 635 Aero G7 Notebook PC
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Those distros no longer do, and Spectacle is a fully Wayland-native app. So there should be no need to handle this case anymore.