Skip to content

Added Wayland support via interactive or non-interactive call - #818

Open
Photon89 wants to merge 8 commits into
masterfrom
wayland-support
Open

Added Wayland support via interactive or non-interactive call#818
Photon89 wants to merge 8 commits into
masterfrom
wayland-support

Conversation

@Photon89

@Photon89 Photon89 commented May 25, 2026

Copy link
Copy Markdown
Member

This PR is based on #817. However, it now tries to use an non-interactive target as defined in flatpak/xdg-desktop-portal#1981. If a target is not yet implemented by a DE, it falls back to an interactive call which shows the DE's interactive mode chooser. As soon as a DE implements the non-interactive targets, Shutter should pick them up and not call the interactive mode chooser any more. Also, the full screen capture is unaffected.

Tested for various DEs:

  • For Gnome the interactive mode chooser works quite well. Limitations: The user needs to choose the capture mode again (after having chosen it in Shutter). Filenames are still set to "unknown".
  • For KDE the interactive mode chooser seems to offer no selection mode. Also there seems to be no window selection mode, only capturing the active window is possible, which is the mode chooser dialog itself though. So in KDE this PR is basically useless.
  • For Cinnamon the interactive mode chooser is not really implemented and always falls back to full screen capture.

Tested non-interactive targets:

@Photon89
Photon89 requested a review from DarthGandalf May 25, 2026 15:23
Comment thread bin/shutter Outdated
@mvivarelli

Copy link
Copy Markdown

Hi Michael,

I'm Maurizio. I wrote the gnome-screenshot hack for Ubuntu 24.04.

I was looking for a solution to extend Shutter's life on Ubuntu 26.04, where gnome-screenshot no longer works.

I tested your PR just now, and it seems to be a temporary but nevertheless pretty usable solution.

Thanks,

Maurizio

@Photon89

Copy link
Copy Markdown
Member Author

Hi Maurizio,

great, thanks for testing! As Gnome hasn't implemented non-interactive targets so far, Shutter has to fall back to the interactive mode chooser. That's actually worse than what you have implemented in your PR. And the sad news is that the non-interactive calls will be supposedly forwarded to gnome-screenshot once they have been implemented, so yeah... At least that's what happens in Cinnamon so far.

Let's hope that this will be good enough for potential users. I guess, we've lost many of them due to lacking Wayland support...

@Photon89 Photon89 linked an issue Aug 9, 2026 that may be closed by this pull request
Comment thread bin/shutter
$supported_targets{'1'} = 1 if ($targets_raw & 1);
$supported_targets{'2'} = 1 if ($targets_raw & 2);
$supported_targets{'4'} = 1 if ($targets_raw & 4);
$supported_targets{'8'} = 1 if ($targets_raw & 8);

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.

in the non-raw version use names instead of digits? Or reverse, even keep it as raw number and check & directly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea, I'll rework it to use names!

sub xdg_portal {
my $screenshooter = shift;
my $interactive = shift;
my $target = shift;

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.

what does target mean? some comments would help

Comment thread bin/shutter
# For some period of time desktops won't support non-interactive targets, we need to deal with it.
my $target;
my $interactive;
# For fullscreen capture just use plain xdg_portal

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.

wouldn't that show the interactive prompt even on supporting compositors?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do you mean the full screen case? I'm not sure, that's the very early Wayland.pm which you wrote, I haven't looked inside tbh. For the moment, I didn't want to change anything with full screen capture because I assumed that it works well already. Do you know what the status actually is with full screen capture?

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.

Selection button inactive (was: Shutter does not work in Wayland)

4 participants