shutter-project / shutter

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

Shutter simply graying itself out uselessly to rot and die with i3 on Fedora 38 #640

Closed jp-x-g closed 3 months ago

jp-x-g commented 6 months ago

I am on Fedora 38, using Shutter 0.399.3 rev 1607 (with i3). Sometimes, when I try to use Shutter to capture a selection, it simply won't -- it lets me drag to make a selection, then it grays out the "selection" buttons, as though it's in the middle of capturing, and simply stays that way forever. No other applications on my computer are unresponsive, just Shutter. It never gave any sort of error message, just the graying of the "Capture" button that usually happens when it's "thinking" (processing a large capture area). However, this time it stayed like that for more than an hour, and did it again after restarting.

I have had this problem some times before. Usually, it is that Shutter will become unreliable and fail when there are too many files in the directory it saves to, and moving them elsewhere causes it to work again. However, in this case, that had no effect, and Shutter is simply sitting there idle. Clearing its cache did not help either.

I can't attach a screenshot because Shutter is the default/only screen capture option and it's broken.

jp-x-g commented 6 months ago

Okay, I think I may have figured out the issue -- Shutter had, somehow, blanked out the entire "Filename" field in the preferences. This meant that it was either trying to save files to a blank filename, or to one that already existed, but instead of giving an error message, it decided instead to simply hang forever and die.

This should be fixed -- the underlying behavior may be too complex to debug (who knows why it had blanked out the filename field, and who knows how to resolve the filename issue), but it should at least give an error message. The only reason I thought to try a timestamp code in the filename field was because I've used the application for a long time and noticed that the field was strangely empty; an inexperienced user and/or non-programmer would likely have found this impossible.

vadi2 commented 6 months ago

Thanks for the report! Just a friendly reminder that Shutter is a FOSS app made by folks in their spare time, so there is no need to be so dramatic about filing issues with it.

jp-x-g commented 6 months ago

Perhaps it was a fit of pique. I have edited my comment for tone; I maintain, though, that this type of silent failure makes the application very difficult to use, and if the underlying issue can't be fixed (it may well be an impractical edge case) it should at least give some indication of what's gone wrong. Debugging this ate a lot of time I was trying to work on a different FOSS project 😿

As penance I will try to replicate it and tell you what my terminal output looks like -- although I'm not going to be able to give you screenshots of what it looks like when it's busted.

jp-x-g commented 6 months ago

Okay, I was able to replicate it perfectly. Here is what I did: Edit > Preferences > Main > Filename, type "shutterbug" or whatever. Then take a screenshot: the first one will work (it will save to shutterbug.png) and then the second one will just hang the capture button forever. The settings still work, as does most of the menu. Here is what I am getting for errors:

Using monitor: 0 - 400 - 3840 - 2160
Parsing wildcards for replicatebug
Parsed $width and $height: replicatebug
Parsed $profile: replicatebug
Parsed $name: replicatebug
New uri after exists check: /home/jpxg/pix/replicatebug.png
Trying to save file to /home/jpxg/pix/replicatebug.png
Saving file /home/jpxg/pix/replicatebug.png, png, 9
Updating fileinfos for key: [2] - replicatebug.png

(shutter:4176516): Gtk-CRITICAL **: 02:22:15.841: gtk_drag_source_set_icon_pixbuf: assertion 'site != NULL' failed
screenshot successfully saved to /home/jpxg/pix/replicatebug.png!
GLib-CRITICAL **: Source ID 11834 was not found when attempting to remove it at /usr/bin/shutter line 6957.
 at /usr/bin/shutter line 6955.
    Shutter::App::fct_show_status_message(1, "replicatebug.png saved") called at /usr/bin/shutter line 6534
    Shutter::App::fct_take_screenshot(Gtk3::ToolButton=HASH(0x55c8b05a1448), "select", undef, undef) called at /usr/bin/shutter line 3038
    Shutter::App::__ANON__() called at /usr/lib64/perl5/vendor_perl/Glib/Object/Introspection.pm line 67
    eval {...} called at /usr/lib64/perl5/vendor_perl/Glib/Object/Introspection.pm line 67
    Glib::Object::Introspection::__ANON__(Shutter::App=HASH(0x55c8afdaf358)) called at /usr/bin/shutter line 10944

select was emitted by widget Gtk3::ToolButton=HASH(0x55c8b05a1448)
Using monitor: 0 - 400 - 3840 - 2160
Parsing wildcards for replicatebug
Parsed $width and $height: replicatebug
Parsed $profile: replicatebug
Parsed $name: replicatebug
*** unhandled exception in callback:
***   Can't locate object method "append_string" via package "Glib::Object::_Unregistered::GLocalFile" at /usr/bin/shutter line 7908.
***     Shutter::App::fct_get_next_filename("replicatebug", "/home/jpxg/pix", "png") called at /usr/bin/shutter line 6330
***     Shutter::App::fct_take_screenshot(Gtk3::ToolButton=HASH(0x55c8b05a1448), "select", undef, undef) called at /usr/bin/shutter line 3038
***     Shutter::App::__ANON__() called at /usr/lib64/perl5/vendor_perl/Glib/Object/Introspection.pm line 67
***     eval {...} called at /usr/lib64/perl5/vendor_perl/Glib/Object/Introspection.pm line 67
***     Glib::Object::Introspection::__ANON__(Shutter::App=HASH(0x55c8afdaf358)) called at /usr/bin/shutter line 10944
***  ignoring at /usr/lib64/perl5/vendor_perl/Glib/Object/Introspection.pm line 67.
 at /usr/bin/shutter line 10944.

Note that the block about gtk_drag_source_set_icon_pixbuf and the "Source ID was not found when attempting to remove it" appears regularly in the console when I'm using the program, and it works fine despite that, so it's not that. It is just the part starting with "append_string" that's unique to the bug.

I think this should get caught by something and throw an error dialogue.

jp-x-g commented 6 months ago

Okay, now I think I see the issue. There are actually two bugs: the first is the silent failure when saving something to a non-incrementing filename. The second is that every time I close Shutter and reopen it, it completely erases the filename no matter how many profiles I've saved it to. It saves the profile name, but it doesn't save the filename field -- that's completely blank when I reopen it, even after attempting to load from the saved profile.

Photon89 commented 6 months ago

There is a partial remedy against filenames without wildcards: https://github.com/shutter-project/shutter/pull/614

There have been several fixes for settings and profile handling which might solve the filename not being there after restart. I'd propose to test https://codeload.github.com/shutter-project/shutter/zip/refs/heads/make_sanity_check_before_applying_settings and see if the problem still appears. Just run Shutter from the .bin/ subdirectory.

Photon89 commented 6 months ago

@jp-x-g Is this still an issue for you with the fixed version? If the issue is fixed, I'll close the report.

Photon89 commented 3 months ago

Closing due to inactivity. Please open a new issue, if the problem persists.