shutter-project / shutter

Screenshot tool for Linux
https://shutter-project.org/
GNU General Public License v3.0
520 stars 34 forks source link

The Status & Future of Shutter #662

Open delinuxco opened 6 months ago

delinuxco commented 6 months ago

Greetings, I am wondering if anyone could share the status & future of Shutter.

Wayland support, updates on a regular bases etc.

What are the challenges for the project that hold it back from moving forward ?

etc...

This is still one of the best screenshot tools in Linux, especially for GTK environments, would hate to see it disappear.

DarthGandalf commented 6 months ago

What are the challenges for the project that hold it back from moving forward ?

Mostly lack of manpower, and horrible codebase. Ideally, to make it maintainable, need to rewrite it from perl to something more sane (rust?), but that's a lot of work.

In fact, it being perl, prevents certain wayland features - e.g. on KDE on wayland KWin checks the process which tries to access the KWin-specific screenshot API, then checks for certain values in the .desktop file of that process. Here it sees the process as /usr/bin/perl, and shutter cannot update the perl's .desktop file to add that kwin flag.

This is still one of the best screenshot tools in Linux, especially for GTK environments, would hate to see it disappear.

Agreed. When I was porting it from gtk2 to gtk3, I wanted to abandon it many times, but shutter is still better than alternatives :(

Photon89 commented 6 months ago

Hi, thanks for the praise and also for worrying about Shutter's future! In my opinion, we are plainly lacking manpower and time resources.

There are many small bugs which we are trying to fix as actively as limited manpower and time resources permit, but the big challenge of adding Wayland support hasn't been worked on since @DarthGandalf implemented full screen mode for Wayland.

We'd gladly accept contributions, but currently it isn't even clear how this Wayland support might look like. The problem is that Wayland is implemented differently on different DEs and distros. For example, on Ubuntu Gnome, if you try to capture a screenshot, a dialog window pops up. Thus, there is no solution which works universally for all DEs and distros, several approaches would have to be implemented separately. For Gnome there is a fork by @mvivarelli: https://github.com/mvivarelli/shutter-on-wayland which makes use of gnome-screenshot. It is a somewhat hackish solution but it works. But to integrate it into our code, we'd need to restructure the new code, which again requires manpower and time. And it would only support Gnome for now.

delinuxco commented 6 months ago

Well, these are tough challenges for sure, I include Shutter in my little Manjaro Cinnamon Spin and it works great on X11. The only thing I could suggest is to make it more easier to integrate as part of a distro, add it to startup items so it is up and running even during ISO evaluation. Right now because the settings uses hard coded user paths, it is difficult.

Shutter is the one of two apps on my little spin that does not work on wayland, and I would like to keep using it, Ksnip works well, but the look on GTK desktops is not the greatest. I have enough issues keeping BackInTime looking decent. But enough about my problems.

If I may brainstorm with you here...

Is AppImage an option?

How about forking Ksnip and porting to GTK and using it as a base?

delinuxco commented 6 months ago

How about cheating :-)

https://www.codeconvert.ai/perl-to-rust-converter

Photon89 commented 6 months ago

Is AppImage an option?

This has been discussed (and even tried to some extent), see #325 and #594. But looks like we need to deal with XDG config folders first (see #492).

How about forking Ksnip and porting to GTK and using it as a base?

I think, this would be even more work than actually implementing Wayland support... :smile:

How about cheating :-)

This might work well on small projects, but I wouldn't expect it to produce usable results on Shutter which consists of many modules and makes use of many dependencies, for which Rust alternatives might or might not exist, but in any case I'd expect the required changes to be too radical for such a tool to take care of them..

mvivarelli commented 6 months ago

Hi Michael,

have you verified that other DE than gnome does not have a utility like gnome-screenshot ?

if turn out that they have I think that my hackish solution is by far the one that require less work to implement

Maurizio

-----Original Message----- From: Michael Kogan @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 03/28/2024 06:13:02 PM

Hi, thanks for the praise and also for worrying about Shutter's future! In my opinion, we are plainly lacking manpower and time resources. There are many small bugs which we are trying to fix as actively as limited manpower and time resources permit, but the big challenge of adding Wayland support hasn't been worked on since @DarthGandalf implemented full screen mode for Wayland. We'd gladly accept contributions, but currently it isn't even clear how this Wayland support might look like. The problem is that Wayland is implemented differently on different DEs and distros. For example, on Ubuntu Gnome, if you try to capture a screenshot, a dialog window pops up. Thus, there is no solution which works universally for all DEs and distros, several approaches would have to be implemented separately. For Gnome there is a fork by @mvivarelli: https://github.com/mvivarelli/shutter-on-wayland which makes use of gnome-screenshot. It is a somewhat hackish solution but it works. But to integrate it into our code, we'd need to restructure it which again requires manpower and time. And it would only support Gnome for now. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

Photon89 commented 6 months ago

For example, xfce4-screenshooter in Xfce doesn't have the -c option which allows to put the image into the clipboard without showing the GUI at all.

mvivarelli commented 6 months ago

And give a try to this ?

https://git.sr.ht/~emersion/grim

i did I little bit of investigation and saw that this module does not work in gnome/wayland but maybe it work for all the rest

in this case the solution could be:

Maurizio

-----Original Message----- From: Michael Kogan @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 03/29/2024 12:12:26 PM

For example, xfce4-screenshooter in Xfce doesn't have the -c option which allows to put the image into the clipboard without showing the GUI at all. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

DarthGandalf commented 6 months ago

maybe it work for all the rest

Nope. It may work for https://gitlab.freedesktop.org/wlroots/wlroots only. We'll need separate solutions for different compositors, and wlroots (sway etc) has its own API for screenshots, yes, which we probably can use - via grim or directly.

mvivarelli commented 6 months ago

reading a little bit more I found:

https://www.reddit.com/r/linux/comments/11z0kcr/desktopagnostic_wayland_compositor/

maybe the solution could be:

but beside that, I think that if my solution is incorporated into the shutter then you pass from:

to

and in the short term this is important for not letting shutter die

Maurizio

-----Original Message----- From: Alexey Sokolov @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 03/31/2024 10:39:14 AM

maybe it work for all the rest

Nope. It may work for https://gitlab.freedesktop.org/wlroots/wlroots only. We'll need separate solutions for different compositors, and wlroots (sway etc) has its own API for screenshots, yes, which we probably can use - via grim or directly. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

vadi2 commented 6 months ago

Agreed. Also a very important fact of it would be managing expectations - as seen here, supporting Wayland is a lot more work than supporting X, and when Shutter does not have a certain $feature folks will be inevitably disappointed - so we need to ensure that we manage their expectations here.

DarthGandalf commented 6 months ago

from:

  • 100% support for X, 0% support for wayland

to

  • 100% support for X, 50% support for wayland (i don't know the exact percentage of gnome and derivative usage)

The current state is not 0%: xdg portal support implemented in 0.99.1 is enough for very simple cases. It even supports both KDE and Gnome. It just doesn't have any more advanced features like Shutter on X did.

and in the short term this is important for not letting shutter die

Agreed, that's why I implemented that.

Now, xdg portal is not a perfect solution, but may be fine as fallback option if there's nothing better for the specific compositor. The gnome-screenshot hack you did still provides more features than xdg portal, but it works only on gnome.

So, shutter needs to detect which compositor is running, and depending on compositor, either use gnome-screenshot (or perhaps we find some better way to interact with gnome), or something specific to wlroots (e.g. grim), or something specific to KDE, etc, or to use the xdg portal as fallback.

mvivarelli commented 6 months ago

"very simple cases" means "usable" ?

becausa if does not means "usable" than I return to my evaluation:

  • 100% support for X, 0% support for wayland

and usable means that you can take active window and selection screenshot

please Alexey, don't take my words bad, I just want the best for Shutter

Maurizio

-----Original Message----- From: Alexey Sokolov @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 03/31/2024 12:19:35 PM

from:

  • 100% support for X, 0% support for wayland to
  • 100% support for X, 50% support for wayland (i don't know the exact percentage of gnome and derivative usage)

The current state is not 0%: xdg portal support implemented in 0.99.1 is enough for very simple cases. It even supports both KDE and Gnome. It just doesn't have any more advanced features like Shutter on X did.

and in the short term this is important for not letting shutter die

Agreed, that's why I implemented that. Now, xdg portal is not a perfect solution, but may be fine as fallback option if there's nothing better for the specific compositor. The gnome-screenshot hack you did still provides more features than xdg portal, but it works only on gnome. So, shutter needs to detect which compositor is running, and depending on compositor, either use gnome-screenshot (or perhaps we find some better way to interact with gnome), or something specific to wlroots (e.g. grim), or something specific to KDE, etc, or to use the xdg portal as fallback. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

Photon89 commented 6 months ago

I think we all agree that merging your code for Gnome is a good idea (@team: please correct me if I'm wrong, but this is my impression from our internal discussions). But, aside from strategic discussions, the practical problem is that it needs to be restructured a lot. Shutter stores the code for the dirty screenshooting work in modules that are located in https://github.com/shutter-project/shutter/tree/master/share/shutter/resources/modules/Shutter/Screenshot We'd need to create modules like SelectorWaylandGnome or WindowWaylandGnome which are called from the main file. The problem is just that currently we lack time to do the work...

DarthGandalf commented 6 months ago

Dunno about SelectorWaylandGnome or WindowWaylandGnome, but yes, gnome-screenshot code needs some restructuring before it can be merged - at least to allow other implementations for other compositors. Currently it just assumes that it can always work on wayland, which is false.

please Alexey, don't take my words bad, I just want the best for Shutter

Of course, not arguing that.

Photon89 commented 6 months ago

We could check whether $XDG_CURRENT_DESKTOP includes "GNOME" and whether /usr/bin/gnome-screenshot exists. If both are true, use Maurizio's code, otherwise revert to the current behavior.

vadi2 commented 6 months ago

Maybe @mvivarelli you can help with the restructuring? Having Shutters code be coherent is important for the projects future.

mvivarelli commented 6 months ago

If I remember well there is a function called fct_screenshot that do the X job

I create a similar fct_gnome_screenshot that work with gnome-screenshot in Wayland

In my code there is a check, if in X use the original code, otherwise use the new fct_gnome_screenshot (that is not correct as it assume that gnome-screenshot is alway available)

At a minimum I think that adding a check that verify also whether $XDG_CURRENT_DESKTOP includes "GNOME" and whether /usr/bin/gnome-screenshot exists could do the job

If Wayland and the condition above are not met the program should go in the "limited functionality mode" that already exists

Maurizio

-----Original Message----- From: Vadim Peretokin @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 03/31/2024 01:21:51 PM

Maybe @mvivarelli you can help with the restructuring? Having Shutters code be coherent is important for the projects future. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

Photon89 commented 6 months ago

If I remember well there is a function called fct_screenshot that do the X job

Exactly, but fct_take_screenshot actually does the job under all circumstances, it then decides which mode to use and calls different modules to do the job. So the differentiation between the different modes and also cases (wayland or X) happens inside fct_take_screenshot.

Also, currently your fork is 76 commits behind master, so automatically merging the changes won't be possible, even if we decided to leave them as is, without restructuring.

Photon89 commented 6 months ago

I'm not saying, we shouldn't do the restructuring and merging. We definitely should do it. It's just not that easy and trivial...

DarthGandalf commented 6 months ago

I think it may be easier to not try to merge it as is, but look how gnome-screenshot is called with which parameters, and reimplement the Shutter side of it from scratch

Photon89 commented 6 months ago

Anybody up for discussing details and possibly do the reimplementation on IRC (https://web.libera.chat/#shutter)?

Photon89 commented 6 months ago

I tried reimplementing the gnome-screenshot idea now with some support by Alexey. Have a look at #667, if you'd like to test it. It's the very first working draft, still needs some work. Also, only Selection mode is supported so far.

mvivarelli commented 5 months ago

Hi Michael,

can I try it using a new Ubuntu 24/04 daily build ?

Maurizio

-----Original Message----- From: Michael Kogan @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 04/02/2024 12:57:21 AM

I tried reimplementing the gnome-screenshot idea now with some support by Alexey. Have a look at #667, if you'd like to test it. It's the very first working draft, still needs some work. Also, only Selection mode is supported so far. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

Photon89 commented 5 months ago

Hi Maurizio, yes, I guess so!

mvivarelli commented 5 months ago

ok,

i'll try next week end

Maurizio

-----Original Message----- From: Michael Kogan @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 04/03/2024 12:11:08 PM

Hi Maurizio, yes, I guess so! — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

mvivarelli commented 5 months ago

Hi Michael,

yesterday I installed the latest daily build of Ubuntu 24.04

cloned #667, installed all the requirement and tested

and all was good!

Maurizio

-----Original Message----- From: Michael Kogan @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 04/02/2024 12:57:21 AM

I tried reimplementing the gnome-screenshot idea now with some support by Alexey. Have a look at #667, if you'd like to test it. It's the very first working draft, still needs some work. Also, only Selection mode is supported so far. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

Photon89 commented 5 months ago

Great, I assume, you tested under Gnome, right?

mvivarelli commented 5 months ago

Yes

Maurizio

-----Original Message----- From: Michael Kogan @.> Reply-To: shutter-project/shutter @.> To: shutter-project/shutter @.> Cc: mvivarelli @.>, Mention @.***> Subject: Re: [shutter-project/shutter] The Status & Future of Shutter (Issue #662) Date: 04/15/2024 02:48:55 PM

Great, I assume, you tested under Gnome, right? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <shutter- @.***>

TNTBOMBOM commented 1 month ago

https://tracker.debian.org/pkg/shutter

looks like shutter going to be removed from next debian release.

vadi2 commented 1 month ago

I see it's due to a dependency that does not build on a certain platform, however a 1-line patch was attached to the dependency in question to fix the issue. Should be okay then?

TNTBOMBOM commented 1 month ago

I see it's due to a dependency that does not build on a certain platform, however a 1-line patch was attached to the dependency in question to fix the issue. Should be okay then?

If it will resolve the issue, it should be ok.

Photon89 commented 1 month ago

Well, I hope that the Debian team will figure it out!

I wanted to report issue and patch upstream but unfortunately the goocanvas project is archived and set to read-only mode, so the patch won't make it into the upstream release...

edit: There is a merge request for this upstream, but it probably won't be merged: https://gitlab.gnome.org/Archive/goocanvas/-/merge_requests/15

The patch is included in various distros already though, like in Arch or Fedora. I am optimistic that Debian will manage to include this patch as well. Thanks for the information though!

Photon89 commented 1 month ago

@DarthGandalf Another news, possibly this PR will help us with Wayland support: https://github.com/flatpak/xdg-desktop-portal/pull/1415