Bug 372408 - Option to omit shadow and transparent border from windows in Active Window and Window Under Cursor modes
Summary: Option to omit shadow and transparent border from windows in Active Window an...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Other Linux
: HI wishlist
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords: usability
: 404143 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-12 23:53 UTC by David Rankin
Modified: 2023-10-23 17:12 UTC (History)
31 users (show)

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


Attachments
Screenshot Showing Areas Outside Active Window (in blue) (37.56 KB, image/png)
2016-11-12 23:53 UTC, David Rankin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Rankin 2016-11-12 23:53:24 UTC
Created attachment 102195 [details]
Screenshot Showing Areas Outside Active Window (in blue)

Version 16.08.3

KDE Frameworks 5.27.0
Qt 5.7.0 (built against 5.7.0)
The xcb windowing system

Spectacle Capture Active Window includes an unwanted additional 10-15 pixel margin or buffer around the outside of the Active Window causing the user to have to manually crop every image taken just to get an actual snapshot of the current window. This is incredibly cumbersome and frustrating. Why would capture 'Active Window' be grabbing an additional 10-15 pixels outside the current window?

Expected behavior - when capturing any window, especially the 'Active Window' spectacle should only capture the 'Active Window' without including any extraneous margin or buffer outside the 'Active Window'

A screenshot is attached showing the unwanted additional info captured outside the active window
Comment 1 David Rankin 2016-11-12 23:55:26 UTC
Note: the space around the 'Active Window' shown in the snapshot is actually transparent in color, but is shown in KDE as a solid color based on your current color scheme.
Comment 2 Peter Wu 2016-11-14 11:04:21 UTC
"Active Window" tries to add an extra shadow effect because it was possible and is supposed to look nicer. I guess that a preference to control this would be useful.

Would an option at Preferences be helpful (not in the main UI since it should not be a commonly changed option)?
Comment 3 Paul 2017-08-11 14:37:22 UTC
(In reply to Peter Wu from comment #2)
> ...because it was possible and is supposed to look nicer...
  Really ?? !!!

> Would an option at Preferences be helpful (not in the main UI since it
> should not be a commonly changed option)?

It most certainly would.  Like the OP, it is infuriating to have to edit the screenshot afterwards to remove this "nicer looking" "feature".  (Sorry folks, don't take it to heart.)
Comment 4 Christoph Haag 2017-08-19 07:39:35 UTC
There absolutely should be a config option and command line switch to disable this (even if you don't agree that it should be disabled by default).

Imagine you want to take a screenshot from a fullscreen window, and then you want to view this image fullscreen 1:1 on the same screen resolution. Sure you can set up and remember yet another hotkey with -m, but then it doesn't even to the exact same thing.
Comment 5 null 2018-01-31 22:16:03 UTC
I agree there should be an option to disable shadows in screenshots.

As a workaround, just disable compositing temporarily, e.g. by pressing Shift+Alt+F12. Alternatively, disable "Include window titlebar and borders" if applicable in your use case.
Comment 6 Jack 2018-02-01 19:00:21 UTC
I absolutely agree.  This is costing me much time in capturing screenshots for a user manual.
Comment 7 Gregor Mi 2018-05-28 10:55:11 UTC
Since years, I use the workaround of choosing "Rectangular Region" and manually draw the capture rectangle when I want to capture a window including title bar. It produces no pixel-perfect results but it is much quicker than to remove the shadow manually in an image editor.

> As a workaround, just disable compositing temporarily, e.g. by pressing Shift+Alt+F12.

Thanks for this hint! I tried it and it works as a good alternative workaround here.
Comment 8 null 2018-05-28 12:23:55 UTC
Reading https://blog.martin-graesslin.com/blog/2018/05/shadows-in-window-screenshots/, support for disabling shadows seems unlikely. Note that I learned about this only from the blog post – Was anybody else from #Spectacle informed about this in advance or involved in the decision?
Comment 9 Nate Graham 2018-05-28 13:14:45 UTC
No, I don't believe anyone was contacted.

It's not just the Dedoimedo guy. We have people wanting to turn them off so they can improve the look of their documentation too. Heck, from time to time I find myself wanting to turn them off or replace them with small ones for the screenshots I post to my blog. I think there are legitimate use cases.

From a UI perspective, what I would like is a set of options for how to handle a window's shadows:
- Use existing shadows
- Replace existing shadows with a very small tasteful shadow (Window Under cursor mode seems to already do a variant of this; it would be nice to make it a universal option)
- Omit shadows entirely, and use alpha to ensure that any rounded corners look proper
Comment 10 Roc Vallès 2018-08-25 15:42:58 UTC
I'm seeing this issue while running spectacle with i3 as window manager.

Screenshots end up being the naked window with a huge transparent frame.

This is the case whether include decorations is ticked or unticked.

This is doubtlessly very broken behavior.
Comment 11 Rog131 2019-02-09 20:44:47 UTC
*** Bug 404143 has been marked as a duplicate of this bug. ***
Comment 12 Peter Wu 2019-06-10 07:29:19 UTC
While Martin rejects the idea of a checkbox in Spectacle to disable shadow effects, can I vote to add such an option? Right now I am taking screenshots for presentation slides where a border effect is already present. I now have to manually remove the border which is extra work.
Comment 13 Nate Graham 2019-06-10 12:59:37 UTC
Martin is not the Spectacle maintainer or even a developer. He also is no longer the KWin maintainer not even very active there anymore. Decisions can be changed; I would not rule this out. I think it's mostly a matter of someone writing a patch do to it.
Comment 14 Boudhayan Gupta 2019-06-11 23:55:59 UTC
There's code in Spectacle that does this, but this is just for consistency with KWin's way of doing this. If someone removed this from KWin, I'll gladly remove the offending code from Spectacle. I personally think the drop shadow is completely unnecessary anyway.
Comment 15 Paul 2019-06-12 07:36:08 UTC
Ridding spectacle of this shadow trumps consistency with KWin...

Go on... remove the offending code... you know you want to... :)
Comment 16 Boudhayan Gupta 2019-06-12 07:55:55 UTC
@Paul: That will do absolutely nothing, since that part of the code is only used if you're not running under KWin.
Comment 17 David Redondo 2019-06-12 08:29:28 UTC
I'm not an expert but couldn't we crop the image after the fact to get the rid of the shadow? I think we could get the dimensions from KWin maybe?
Comment 18 Boudhayan Gupta 2019-06-12 08:46:06 UTC
Why would we do that? We (KDE) own the KWin code, let's fix it properly!
Comment 19 Johannes E. Krause 2019-06-12 08:53:57 UTC
(In reply to Henrik Fehlauer from comment #8)
> Reading
> https://blog.martin-graesslin.com/blog/2018/05/shadows-in-window-screenshots/
> , support for disabling shadows seems unlikely. Note that I learned about
> this only from the blog post – Was anybody else from #Spectacle informed
> about this in advance or involved in the decision?

i'm not sure if we're still talking about the same thing. but in Bug 404143 i specifically talked about the situation where you disable showing window decorations, but it doesn't remove the shadow, which i would argue is part of the decoration.
Comment 20 Paul 2019-06-12 10:28:32 UTC
(In reply to Boudhayan Gupta from comment #16)
> @Paul: That will do absolutely nothing, since that part of the code is only
> used if you're not running under KWin.

In comment #2 it was implied, at least that's how I read it, that this shadow/border was a "feature" added to spectacle.  I guess I was wrong, which seems the norm these days, argh... ;)
Comment 21 Kristen McWilliam 2020-02-23 19:56:11 UTC
I've been trying to figure out why my screenshots looked weird, finally looked into it and found it was this capturing shadows thing.

Disabling compositing is a decent workaround for now, but this is my vote for a proper setting to change this behaviour.
Comment 22 Felix Miata 2020-03-11 05:25:21 UTC
I deselect "Enable compositor on startup" automatically on first use ever since global disabling began preventing Plasma from starting at all, and get the annoying borders anyway. :(
Comment 23 Guo Yunhe 2020-09-26 09:41:12 UTC
Looking for the same feature...
Comment 24 ratijas 2021-09-06 11:32:36 UTC
Adding myself to CC…
Comment 25 Zamundaaa 2021-10-22 08:50:19 UTC
*** Bug 444133 has been marked as a duplicate of this bug. ***
Comment 26 Eduardo 2021-12-10 15:26:36 UTC
This is a must-have. These borders are incredibly annoying, every window screenshot that I take I have to open an image editor and manually crop the borders. The first time I saw it, it caused a really bad impression, I didn't see it as a feature, but as a bug, and that's still how I see it today, despite it being the intentional behavior picked by the developer. When we take screenshots on Windows, Android, iOS, macOS, Gnome, it never comes with those borders. This "innovative" behavior is not what users are expecting, will always negatively surprise new users, and will continue to annoy users until it is fixed.  This can't be ignored. It is bad for users, it is bad for KDE. I don't mean to sound rude, that's just my honest feedback as a user.

I understand it was done this way to fix a bug related to the corners, but it is not the best solution, we should pursue some kind of smooth transition of the rounded corners. It shouldn't be hard to do, and we could even look up & borrow code from other pieces of free software that already implement this solution.

I think the default behavior should be borderless and I don't think an option to add the borders is even necessary.
Comment 27 Ewald Müller 2023-03-07 20:55:17 UTC
(In reply to Peter Wu from comment #12)
> While Martin rejects the idea of a checkbox in Spectacle to disable shadow
> effects, can I vote to add such an option? Right now I am taking screenshots
> for presentation slides where a border effect is already present. I now have
> to manually remove the border which is extra work.

This affects me to and it's very annoying; think of the extra amount of black ink when the screenshot has to be printed.
Comment 28 Jack 2023-09-27 21:34:22 UTC
I'm starting a new round of Manual updating, and tripped over this again - having completely forgotten about it.  I'm now looking for an alternative to spectacle.  I'm curious if this is not being done because someone objects or just because nobody has stepped up to actually do the work?
Comment 29 Nate Graham 2023-09-27 21:49:24 UTC
Nobody has done it yet.
Comment 30 Noah Davis 2023-10-09 19:04:01 UTC
The biggest reason why it hasn't been done is there's currently no way to do it.
Comment 31 Jack 2023-10-11 22:21:10 UTC
Can you explain why not?  Many of the earlier comments in this bug implied it is quite possible, but as I read it, would take patches to both spectacle and kwin.  Is it really not possible, or is it just waiting for a PR and agreement that kwin be changed?
Comment 32 Noah Davis 2023-10-12 07:29:27 UTC
(In reply to Jack from comment #31)
> Can you explain why not?  Many of the earlier comments in this bug implied
> it is quite possible, but as I read it, would take patches to both spectacle
> and kwin.  Is it really not possible, or is it just waiting for a PR and
> agreement that kwin be changed?

I was referring to the fact that there's currently no way to do it in Spectacle. I didn't see that you had earlier comments, so I suppose you didn't need to read that. Spectacle is switching to using the screenshot KWin plugin whenever it's available, so the patching would have to be done entirely within KWin.
Comment 33 Bug Janitor Service 2023-10-12 17:50:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4499
Comment 34 Bug Janitor Service 2023-10-12 22:59:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/272
Comment 35 Noah Davis 2023-10-22 12:51:13 UTC
Git commit 5c8b85861e93b3b2d484b50336547547ba1f4b38 by Noah Davis, on behalf of Kristen McWilliam.
Committed on 22/10/2023 at 14:34.
Pushed by ndavis into branch 'master'.

plugins/screenshot: make window shadows optional

Right now screenshots of windows always have drop shadows. This change
makes the shadows optional. Resolves a 7-year-old bug report in
conjunction with an incoming change to Spectacle.

M  +6    -0    src/plugins/screenshot/org.kde.KWin.ScreenShot2.xml
M  +3    -0    src/plugins/screenshot/screenshot.cpp
M  +1    -0    src/plugins/screenshot/screenshot.h
M  +5    -0    src/plugins/screenshot/screenshotdbusinterface2.cpp

https://invent.kde.org/plasma/kwin/-/commit/5c8b85861e93b3b2d484b50336547547ba1f4b38
Comment 36 Noah Davis 2023-10-22 13:02:01 UTC
Git commit 0b3419e95198831e167538696285b7927c9b150d by Noah Davis, on behalf of Kristen McWilliam.
Committed on 22/10/2023 at 15:01.
Pushed by ndavis into branch 'master'.

feat: add window shadows to the capture options

Right now screenshots of windows always have drop shadows. This change
makes the shadows optional. Resolves a 7-year-old bug report in
conjunction with an incoming change to kwin.

M  +12   -0    dbus/org.kde.Spectacle.xml
M  +3    -0    doc/index.docbook
M  +5    -22   src/CommandLineOptions.h
M  +10   -0    src/Gui/CaptureSettingsColumn.qml
M  +13   -0    src/Gui/OptionsMenu.cpp
M  +1    -0    src/Gui/OptionsMenu.h
M  +4    -0    src/Gui/SettingsDialog/spectacle.kcfg
M  +2    -1    src/Platforms/ImagePlatform.h
M  +7    -1    src/Platforms/ImagePlatformKWin.cpp
M  +3    -1    src/Platforms/ImagePlatformKWin.h
M  +60   -36   src/Platforms/ImagePlatformXcb.cpp
M  +21   -6    src/Platforms/ImagePlatformXcb.h
M  +2    -1    src/Platforms/PlatformNull.cpp
M  +5    -1    src/Platforms/PlatformNull.h
M  +13   -11   src/SpectacleCore.cpp
M  +4    -3    src/SpectacleCore.h
M  +6    -4    src/SpectacleDBusAdapter.cpp
M  +2    -2    src/SpectacleDBusAdapter.h

https://invent.kde.org/graphics/spectacle/-/commit/0b3419e95198831e167538696285b7927c9b150d