Added Wayland support via interactive or non-interactive call - #818
Added Wayland support via interactive or non-interactive call#818Photon89 wants to merge 8 commits into
Conversation
|
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 |
|
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... |
| $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); |
There was a problem hiding this comment.
in the non-raw version use names instead of digits? Or reverse, even keep it as raw number and check & directly?
There was a problem hiding this comment.
Good idea, I'll rework it to use names!
| sub xdg_portal { | ||
| my $screenshooter = shift; | ||
| my $interactive = shift; | ||
| my $target = shift; |
There was a problem hiding this comment.
what does target mean? some comments would help
| # 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 |
There was a problem hiding this comment.
wouldn't that show the interactive prompt even on supporting compositors?
There was a problem hiding this comment.
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?
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:
Tested non-interactive targets: