Skip to content

wayland: per-monitor screenshot capture + redoshot support - #828

Open
underwaterdba wants to merge 1 commit into
shutter-project:masterfrom
underwaterdba:features/wayland_monitors
Open

wayland: per-monitor screenshot capture + redoshot support#828
underwaterdba wants to merge 1 commit into
shutter-project:masterfrom
underwaterdba:features/wayland_monitors

Conversation

@underwaterdba

Copy link
Copy Markdown

Adding limited support for Wayland after Gnome 50 / Fedora 44 removed X11.

Wayland screenshots:

Add per-monitor capture on Wayland: the "Full" dropdown lists each monitor and crops the XDG portal's full-desktop capture to the chosen monitor (HiDPI-aware scaling).
Fix xdg_portal error handling: a "return" inside the eval block only exited the eval, so a non-zero/failed portal response returned undef and surfaced as the misleading "selection width or height is zero" error. It now returns a proper error code and message.
Wrap the Wayland capture in an object with capture/redo_capture/ get_history so full and per-monitor captures are repeatable via the redoshot (F5) shortcut; allow redoshot through the no-X11 guard.

@underwaterdba

Copy link
Copy Markdown
Author

@DarthGandalf - I've removed the two features that are really just QoL to make my life easier generating audit evidence, let me know if / how you would like them added.

the first feature focus on being able to set the $name from the main ui so I can name the evidence screenshots.

the second feature just full screen's the edit window and zoom to fit the image so I can apply redactions without having to zoom as well as support for esc to close the edit screen. Again let me know if you want this feature in the main app.

@DarthGandalf

Copy link
Copy Markdown
Member

I'm on review spree and noticed this (well, the previous) PR after #818 - these two will conflict though as is. Can you take a look how these features should interact?

I've removed the two features that are really just QoL to make my life easier generating audit evidence, let me know if / how you would like them added.

This does sound useful, but as separate PRs please. It just makes it easier to review, when different hunks in the diff belong to one feature

Add per-monitor capture on Wayland: the "Full" dropdown lists each monitor and crops the XDG portal's full-desktop capture to the chosen monitor (HiDPI-aware scaling).

In the menu it still provides the option to do all monitors, right? I don't use wayland, so it's hard to test here


#Object wrapper around the portal so full/monitor captures can be repeated
#(e.g. via the redoshot/F5 shortcut) just like the X11 screenshooters.
sub new {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resources/modules/Shutter/App/Common.pm uses a different (more modern) way to create a class and properties; shouldn't this do the same?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and perhaps this should inherit from Shutter/Screenshot/Main.pm like other screenshotters do? The previous code here is mostly a hack

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this should likley go somewhere else, I needed to get my evidence collected and after failing to get x11 working on g50 and giving up on kde as well as alternatives I decided to add the functions I needed to Shutter.

this came about as I updated my desktop and was against a wall to get the evidence collected, did not take the time to review the whole project just added what I needed.

@DarthGandalf

DarthGandalf commented Aug 14, 2026

Copy link
Copy Markdown
Member

re redo: I assume your compositor doesn't show the prompt when you click the button? The compositors with the prompt is why I didn't add this feature

Edit: What DE are you using?

@Photon89

Copy link
Copy Markdown
Member

May be this feature can be enabled conditionally, depending on the value of $interactive (see #818)?

@underwaterdba

Copy link
Copy Markdown
Author

I'm on review spree and noticed this (well, the previous) PR after #818 - these two will conflict though as is. Can you take a look how these features should interact?

I've removed the two features that are really just QoL to make my life easier generating audit evidence, let me know if / how you would like them added.

This does sound useful, but as separate PRs please. It just makes it easier to review, when different hunks in the diff belong to one feature

Add per-monitor capture on Wayland: the "Full" dropdown lists each monitor and crops the XDG portal's full-desktop capture to the chosen monitor (HiDPI-aware scaling).

In the menu it still provides the option to do all monitors, right? I don't use wayland, so it's hard to test here

If you click "Desktop" it will default to all monitors, if you drop down to a display it crops the main screenshot to just the pixels rendered by a specific monitor. My main use case is I run 4 monitors and need to capture a specific screen for Audit collection evidence.

When doing a redoshot after selecting a specific monitor it would not capture anything requiring a selection from the menu again.

@underwaterdba

Copy link
Copy Markdown
Author

re redo: I assume your compositor doesn't show the prompt when you click the button? The compositors with the prompt is why I didn't add this feature

Edit: What DE are you using?

I use Fedora 44 with Gnome 50 (Wayland) I lost track of the amount of time I tried to get Xorg running in G50 and KDE is just unusable for me at this point.

@underwaterdba

Copy link
Copy Markdown
Author

I'm on review spree and noticed this (well, the previous) PR after #818 - these two will conflict though as is. Can you take a look how these features should interact?

I've removed the two features that are really just QoL to make my life easier generating audit evidence, let me know if / how you would like them added.

This does sound useful, but as separate PRs please. It just makes it easier to review, when different hunks in the diff belong to one feature

Add per-monitor capture on Wayland: the "Full" dropdown lists each monitor and crops the XDG portal's full-desktop capture to the chosen monitor (HiDPI-aware scaling).

In the menu it still provides the option to do all monitors, right? I don't use wayland, so it's hard to test here

Let's see how this goes and I'll raise the additional PR's to merge them in when ready. They are branches on my fork if you want to review them but I've not tested them seperatly yet just put them as placeholders to keep my changes for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants