Bug 411290 - Capture Mode "Window Under Cursor" results in different screenshot than "Active Window"
Summary: Capture Mode "Window Under Cursor" results in different screenshot than "Acti...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Leon De Andrade
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-25 18:43 UTC by Leon De Andrade
Modified: 2023-12-08 12:15 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot in active Window mode (19.83 KB, image/png)
2019-08-25 18:43 UTC, Leon De Andrade
Details
Screenshot in Window under Cursor mode (131.03 KB, image/png)
2019-08-25 18:44 UTC, Leon De Andrade
Details
ActiveWindow_transparency (29.10 KB, image/png)
2019-09-11 22:34 UTC, Antonio Prcela
Details
WindowUnderCursor_transparency_CaptureTheCurrentPopupDISABLED (777.44 KB, image/png)
2019-09-11 22:34 UTC, Antonio Prcela
Details
WindowUnderCursor_transparency_CaptureTheCurrentPopupENABLED (29.03 KB, image/png)
2019-09-11 22:35 UTC, Antonio Prcela
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leon De Andrade 2019-08-25 18:43:41 UTC
Created attachment 122353 [details]
Screenshot in active Window mode

SUMMARY

In general, these two capture modes confuse me as it's not 100% clear to me what they do. From the name, they should differ only on how they select the Window. "Active Window" screenshots the active Window and "Window under Cursor" screenshots the window under the cursor (under = x or z value?). So in my understanding if both options screenshot the same application, the screenshot should look the same. This is not the case for applications with a transparent background. Furthermore the "Capture the current-popup only" is disabled in the "Active Window" mode. 

STEPS TO REPRODUCE
1. Screenshot an application with a tranparent/semi-transparent background in both modes

1. Observe the "Capture the current-popup only" checkbox in both modes selected

OBSERVED RESULT

As can be seen from the screenshot "Window under cursor" results in a screenshot, where my background is still transparent while with "Active Window" the background is not transparent anymore. 

"Capture the current-popup only" checkbox is disabled in the "Active Window" Mode


EXPECTED RESULT

Screenshot should look the same in  both modes. If the background of the application should be transparent or not should be determined by a checkbox.

I see no specific reason though why it shouldn't be available for "Active Window" capture mode. 


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Leon De Andrade 2019-08-25 18:44:35 UTC
Created attachment 122354 [details]
Screenshot in Window under Cursor mode
Comment 2 Nate Graham 2019-08-26 16:08:20 UTC
I was wondering when someone was going to file a bug for this. :)

What seems to be happening is that "Active Window" captures the window's own shadow, while "Window under Cursor" doe snot, and adds a shadow later.

Definitely open to fixing this--and also allowing shadow inclusion to be disabled entirely (see Bug 372408).
Comment 3 Leon De Andrade 2019-08-26 16:40:37 UTC
What behaviour would you prefer? Or should this be determined by a checkbox. 
I think windows as they are (e.g. transparent) is what most people want/expect, so I would make this the default behaviour and perhaps add an option in the settings to change it. 

I suppose we have to change that beviour in kwin/Screenshot as it's implemented there mostly? 

> Definitely open to fixing this
Lack of knowledge of the English language here, what do you mean? Do you like to fix it or would you like to see someone fixing it? 

In case, you mean the second one, I can take a look at it. But perhaps next week as I will be on holidays this week :) 
But if someone else want to fix it instead including you, feel free to claim the bug as yours and assign yourself to it. It's all yours :)
Comment 4 Nate Graham 2019-08-26 16:49:22 UTC
Sorry, I was unclear. I'm definitely open to this being fixed (by someone, not necessarily me). :)

I think the behavior for "Active window" should be used for "Window Under Cursor" mode as well, and then we should have a user-configurable option to omit window shadows from the screenshot when using one of those two modes.
Comment 5 Leon De Andrade 2019-08-26 16:58:27 UTC
No worries! I'll have a look when I'm back if the bug is tackled by someone or not :) 

If someone is interested in fixing this bug (or giving it a shot), please assign yourself to it, so I (and others) know that someone is working on it.
Comment 6 Antonio Prcela 2019-09-11 22:33:56 UTC
I just tested this a bit..

To get the same picture with "Active Window" and "Window under cursor", you have to check "Capture the current pop-up only" in "Window under cursor".
I'll attach 3 images. All were made with Konsole having transparency enabled.

ActiveWindow_transparency -> Screenshot made with "Active Window"
WindowUnderCursor_transparency_CaptureTheCurrentPopupENABLED -> Screenshot made with "Window under Cursor" & "Capture the current pop-up only" ENABLED

^ Same shadows, no transparency.

WindowUnderCursor_transparency_CaptureTheCurrentPopupDISABLED -> Screenshot made with "Window under Cursor" & "Capture the current pop-up only" DISABLED

^ No window shadow, no decorations, and transparency in Konsole active.

The difference is here: https://cgit.kde.org/spectacle.git/tree/src/Gui/KSWidget.cpp#n217

If we choose "Window under Cursor" & uncheck "Capture the current pop-up only", than it switches over to "CaptureMode::TransientWithParent" mode. And that mode forces a BLUR radius with shadow effect:

https://cgit.kde.org/spectacle.git/tree/src/Platforms/PlatformXcb.cpp#n653
Comment 7 Antonio Prcela 2019-09-11 22:34:23 UTC
Created attachment 122617 [details]
ActiveWindow_transparency
Comment 8 Antonio Prcela 2019-09-11 22:34:50 UTC
Created attachment 122618 [details]
WindowUnderCursor_transparency_CaptureTheCurrentPopupDISABLED
Comment 9 Antonio Prcela 2019-09-11 22:35:03 UTC
Created attachment 122619 [details]
WindowUnderCursor_transparency_CaptureTheCurrentPopupENABLED
Comment 10 Leon De Andrade 2019-09-13 14:17:00 UTC
Thank you @Antonio for investigating it further. 

I'm pretty sure this is not how it supposed to be. I would take this issue very soon (unless you want to give it a shot?). 

Personally, which indirectly would fix this issue automatically, I would like to see a combined new option "Select Window" ... I believe a lot of the backend exists already, at least when kwin is available. 
I might will open a task on phab to discuss how it should be, before I submit any change.
Comment 11 Antonio Prcela 2019-09-13 14:22:06 UTC
(In reply to Leon De Andrade from comment #10)
> Thank you @Antonio for investigating it further. 
> 
> I'm pretty sure this is not how it supposed to be. I would take this issue
> very soon (unless you want to give it a shot?). 
> 
> Personally, which indirectly would fix this issue automatically, I would
> like to see a combined new option "Select Window" ... I believe a lot of the
> backend exists already, at least when kwin is available. 
> I might will open a task on phab to discuss how it should be, before I
> submit any change.

Go on and do it. Since I'm currently trying to implement copy to clipboard for DBUS. Which seems to be more complicated than I expected. And I rather won't work on two things, or else I mix up or miss something (like I did recently).
Comment 12 Noah Davis 2023-12-08 12:15:01 UTC
This seems to be fixed, especially now that Spectacle use KWin to get screenshots on Wayland and X11.