Bug 501593 - I am unable to capture screenshots of Krita's loading window and Plasma Shell's Desktop via "Active Window" mode
Summary: I am unable to capture screenshots of Krita's loading window and Plasma Shell...
Status: CONFIRMED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL: https://discuss.kde.org/t/unable-to-c...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-16 16:17 UTC by Roke Julian Lockhart Beedell
Modified: 2025-07-04 00:10 UTC (History)
2 users (show)

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


Attachments
A Screenshot of the Error in the Initial Spectacle GUI (61.51 KB, image/png)
2025-03-16 16:17 UTC, Roke Julian Lockhart Beedell
Details
A Screenshot of the Error Modal Window Spawned by the Preview Spectacle GUI (31.65 KB, image/png)
2025-03-16 16:21 UTC, Roke Julian Lockhart Beedell
Details
A Screenshot of an Apparently Empty Krita Window Captured by Spectacle When it Should Have Captured the Content (10.89 KB, image/png)
2025-03-16 16:22 UTC, Roke Julian Lockhart Beedell
Details
A Screenshot Of Android Studio's "Choose Process" Window (21.68 KB, image/png)
2025-04-25 22:23 UTC, Roke Julian Lockhart Beedell
Details
A Screenshot Of Spectacle When Attempting To Capture Android Studio's "Choose Process" Window Via The "Active Window" Mode (75.21 KB, image/png)
2025-04-25 22:24 UTC, Roke Julian Lockhart Beedell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roke Julian Lockhart Beedell 2025-03-16 16:17:52 UTC
Created attachment 179467 [details]
A Screenshot of the Error in the Initial Spectacle GUI

SUMMARY

I am unable to capture screenshots using "Active Window" mode for the Plasma shell desktop under very specific circumstances:

1. When the *initial* Spectacle GUI is used, so not the one that displays an image. In this case, the key bindings continue to operate.
2. I'm attempting to capture a screenshot of Krita's loading window, whether via the initial or preview-based GUIs. In *that* case, "Select Window" works, but the key bindings do not.

STEPS TO REPRODUCE

The more comprehensive reproduction steps are aforementioned. The undermentioned are very specific steps to reproduce one of the two problems:

1. Invoke "spectacle --new-instance" (twice).
2. Hide all windows, except that which is for the desktop.
3. Select the desktop.
4. Select Spectacle's GUI.
5. Select "Active Window".

OBSERVED RESULT

I am unable to capture the screenshot. Instead, I see the undermentioned:

> An error occurred while taking a screenshot.  
> KWin screenshot request failed:  
> Invalid window requested  
> Potentially relevant information:  
> - Method: CaptureActiveWindow  
> - Method specific arguments: QMap(("include-decoration", QVariant(bool, true))("include-shadow", QVariant(bool, false))("native-resolution", QVariant(bool, true)))  

EXPECTED RESULT

I should always be able to capture the focused window in "Active Window" mode.

SOFTWARE/OS VERSIONS

> Operating System: Fedora Linux 41  
> KDE Plasma Version: 6.3.3  
> KDE Frameworks Version: 6.12.0  
> Qt Version: 6.8.2  
> Kernel Version: 6.13.6-200.fc41.x86_64 (64-bit)  
> Graphics Platform: Wayland

ADDITIONAL INFORMATION

Originally discussed at https://discuss.kde.org/t/unable-to-capture-screenshot-of-krita-loading-window/31426/5?u=rokejulianlockhart.
Comment 1 Roke Julian Lockhart Beedell 2025-03-16 16:18:34 UTC
(In reply to Roke Julian Lockhart Beedell from comment #0)  
I'm using "spectacle-6.3.3-1.fc41.x86_64". I don't know what date-based version that correlates with in Bugzilla, so I've left this as "Unspecified".
Comment 2 Roke Julian Lockhart Beedell 2025-03-16 16:21:46 UTC
Created attachment 179468 [details]
A Screenshot of the Error Modal Window Spawned by the Preview Spectacle GUI
Comment 3 Roke Julian Lockhart Beedell 2025-03-16 16:22:36 UTC
Created attachment 179469 [details]
A Screenshot of an Apparently Empty Krita Window Captured by Spectacle When it Should Have Captured the Content
Comment 4 Roke Julian Lockhart Beedell 2025-03-16 16:57:20 UTC
(In reply to Roke Julian Lockhart Beedell from comment #0)  
> I'm attempting to capture a screenshot of Krita's loading window, whether via the initial or preview-based GUIs. In *that* case, "Select Window" works, but the key bindings do not.

According to https://discuss.kde.org/t/unable-to-capture-screenshot-of-krita-loading-window/31426/9?u=rokejulianlockhart, this also occurs on GIMP and Audacity's loading windows, so it's not Krita-specific.
Comment 5 Nate Graham 2025-03-17 19:28:50 UTC
With the git master version, I can't reproduce this issue with those steps for the Plasma desktop (which indeed is technically a window, as you appeared to be probing).

However I can sort of reproduce it for Krita's splash screen; it doesn't want to be counted as an active window; Spectacle screenshots whatever was one window lower in the window stacking order.

I don't see the error message you do though. It just screenshots something else.
Comment 6 Roke Julian Lockhart Beedell 2025-03-17 19:32:42 UTC
(In reply to Nate Graham from comment #5)  
> However I can sort of reproduce it for Krita's splash screen; it doesn't want to be counted as an active window; Spectacle screenshots whatever was one window lower in the window stacking order.
> 
> I don't see the error message you do though. It just screenshots something else.

That's indeed the behaviour I saw that caused the empty window screenshot to be generated. I'd thought I was going crazy, because I could have sworn I'd see for a mere moment in Spectacle's preview the loading window, before it'd be (apparently) automatically replaced by the desktop or main Krita GUI.
Comment 7 Roke Julian Lockhart Beedell 2025-04-25 22:23:35 UTC
Created attachment 180667 [details]
A Screenshot Of Android Studio's "Choose Process" Window

(In reply to Nate Graham from comment #5)

Perhaps it'll be easier for you to test with the Android Studio Flatpak package. As https://github.com/flathub/com.google.AndroidStudio/issues/268#issue-3021075697 demonstrates, the "Run" > "Attach Debugger to Android Process" > "Choose Process" window, very strangely, also generates the same error:

> An error occurred while taking a screenshot.  
> KWin screenshot request failed:  
> Invalid window requested  
> Potentially relevant information:  
> - Method: CaptureActiveWindow  
> - Method specific arguments: QMap(("include-decoration", QVariant(bool, true))("include-shadow", QVariant(bool, false))("native-resolution", QVariant(bool, true)))
Comment 8 Roke Julian Lockhart Beedell 2025-04-25 22:24:35 UTC
Created attachment 180668 [details]
A Screenshot Of Spectacle When Attempting To Capture Android Studio's "Choose Process" Window Via The "Active Window" Mode

(In reply to Roke Julian Lockhart Beedell from comment #7)
Comment 9 Noah Davis 2025-07-03 21:37:12 UTC
It's not completely clear, but it seems like it might be intentional that you can't get screenshot from KWin of the real screenlocker for security. You should be able to to take screenshots if you open the screenlocker in a window like what was described in the original discussion thread. Spectacle may be able to get a message from KWin to cancel the screenshot so that you don't see this as an error in the future.
Comment 10 Roke Julian Lockhart Beedell 2025-07-03 21:47:58 UTC
(In reply to Noah Davis from comment #9)

I presume that you're referring to https://bugs.kde.org/show_bug.cgi?id=506534. If so, have you seen https://discuss.kde.org/t/how-to-screenshot-kscreenlocker/36494/15?u=rokejulianlockhart? It's quite possible, on both Wayland and X: it's solely on my laptop that it fails, and without CSDs, it's just a window like any other.
Comment 11 Noah Davis 2025-07-04 00:10:45 UTC
(In reply to Roke Julian Lockhart Beedell from comment #10)
> (In reply to Noah Davis from comment #9)
> 
> I presume that you're referring to
> https://bugs.kde.org/show_bug.cgi?id=506534. If so, have you seen
> https://discuss.kde.org/t/how-to-screenshot-kscreenlocker/36494/
> 15?u=rokejulianlockhart? It's quite possible, on both Wayland and X: it's
> solely on my laptop that it fails, and without CSDs, it's just a window like
> any other.

oops, commented in the wrong report