Bug 462954 - Allow the user to graphically choose which individual UI elements on screen to include in the screenshot
Summary: Allow the user to graphically choose which individual UI elements on screen t...
Status: CONFIRMED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 22.12.0
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 472410 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-12-12 13:21 UTC by andreas
Modified: 2023-12-13 21:26 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andreas 2022-12-12 13:21:57 UTC
SUMMARY
***
The user has to define which element want to selected. What if you can do the other way around. Click print and than Spectacle show you:
- desktop background
- desktop widgets
- each application window
- mouse hover

and you can show/hide each elemente like you did in an gimp/krita by turn layer on/off. In addition you can export this layered image to gimp/krita/... and postedit the screenshot.
***

The first step would be to save not only a screenshot (stupid image) from whatever the user seleceted. Spectacle save each element (app window, wallpaper, ...) as an image layer and by export the image to an application that know layers like gimp/krita/... the "stupid" image was an image with layers where you can postprocess the image.

Also Annotations would be a separate layer so it will be easier to edit there something.
Comment 1 andreas 2022-12-12 13:22:25 UTC
The main issue is, that .png didn't offer layers by default.
Comment 2 Noah Davis 2023-01-17 02:40:01 UTC
This would be super cool. It reminds me of GammaRay and Firefox's screenshot tool.

I kind of doubt we could get it to work with individual UI elements like Firefox. Unlike the web where everything mostly boils down to HTML, JavaScript and CSS, there are multiple GUI toolkits that are used in desktop environments. Supporting all of the most common ones, or even just Qt, would probably also require depending on private library code, which is part of how GammaRay is able to work.

Some of what you mentioned is already possible to take exact screenshots of using Active Window or Window Under Cursor, though not currently in the integrated workflow you seem to be thinking of. A UI that can interactively let you add windows, context menus, applet popups and the desktop is certainly something I'd like to add to Spectacle, although I think for wayland, the UI might need to be handled by KWin rather than Spectacle due to technical reasons (we'll see). I'm not sure what can be done for X11, but considering how much more permissive it is, I don't see why it couldn't be done. Maybe it could also allow grabbing panels and plasma widgets on the desktop separately from the desktop (as you seem to be requesting in item 2), though not sure about that last one.
Comment 3 Noah Davis 2023-01-17 02:54:59 UTC
Actually, I wonder if there's some way we could use accessibility infrastructure to get UI elements from within a UI, regardless of toolkit as long as it has basic accessibility support?
Comment 4 Nate Graham 2023-01-17 03:11:09 UTC
KWin knows what a window is, which is something we can count on. So at a minimum, we could implement "pick a window" mode. Then we could collapse Active Window and Window Under Cursor mode into that, and be left with only three modes for the single-monitor use case:
- Full screen
- Pick a region of the screen
- Pick a window
Comment 5 Nate Graham 2023-09-08 19:58:52 UTC
*** Bug 472410 has been marked as a duplicate of this bug. ***
Comment 6 unblended_icing552 2023-09-13 04:41:59 UTC
Snipaste (https://www.snipaste.com/) implements this in fine-grain with Accessibility API on Windows. Perhaps something similar could be done on KDE?