shutter-project / shutter

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

Shutter Editor Broken Unless Ran As Root #533

Closed gsperry2011 closed 1 year ago

gsperry2011 commented 1 year ago

Brief summary of issue

When I select to edit a screenshot the editor does not open unless shutter is ran as root. Screenshot capability is fine as normal user, only editor is broken.

Steps to reproduce the issue

(as a non root user)

  1. Take screenshot
  2. Right click the screenshot and select "edit"
  3. No editor window appears

Error output

I've been using shutter for years and been able to edit in this manner. I ran updates last night and the latest version of shutter seems to not show my editor which unfortunately sort of locks my system up as all inputs are being captured by the editor but it is not visible for me to close. I can manually kill shutter from the CLI to regain control of my system.

Everything is normal for me if I run shutter as root.

If I call shutter from the commandline as myself (not root) and try to edit a picture I get this output:

/home/greg/Pictures/Selection_147.png - changed
Updating fileinfos REJECTED for key: [2] - Selection_147.png (not modified)
changes-done-hint - [2] - Selection_147.png

WARNING: Could not load icon for Firefox Web Browser: Can't locate object method "get_names" via package "Glib::IO::FileIcon" at /usr/bin/shutter line 8629.
eval {...} called at /usr/bin/shutter line 8628
Shutter::App::fct_ret_program_menu(Gtk3::Menu=HASH(0x55b71eba1540)) called at /usr/bin/shutter line 590
Shutter::App::__ANON__(Gtk3::Menu=HASH(0x55b71eb71870), "tab-forward") called at /usr/share/perl5/Gtk3.pm line 1392
eval {...} called at /usr/share/perl5/Gtk3.pm line 1392
Gtk3::Menu::popup_for_device(Gtk3::Menu=HASH(0x55b71eb71870), undef, undef, undef, undef, undef, 3, 79139107) called at /usr/share/perl5/Gtk3.pm line 1367
Gtk3::Menu::popup(Gtk3::Menu=HASH(0x55b71eb71870), undef, undef, undef, undef, 3, 79139107) called at /usr/bin/shutter line 3295
Shutter::App::evt_tab_button_press(Gtk3::EventBox=HASH(0x55b71fca0138), Gtk3::Gdk::EventButton=SCALAR(0x55b71eeb6420), "[2] - Selection_147.png") called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Glib/Object/Introspection.pm line 67
eval {...} called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Glib/Object/Introspection.pm line 67
Glib::Object::Introspection::__ANON__(Shutter::App=HASH(0x55b71e070480)) called at /usr/bin/shutter line 10943

fct_update_tray_menu was called by Wnck::Screen=HASH(0x55b71eabd200)
^C
quit was emitted by widget
GLib-CRITICAL **: Source ID 1210 was not found when attempting to remove it at /usr/bin/shutter line 6906.
at /usr/bin/shutter line 6904.
Shutter::App::fct_show_status_message(1, "Settings saved successfully!") called at /usr/bin/shutter line 4611
Shutter::App::fct_save_settings(undef) called at /usr/bin/shutter line 3184
Shutter::App::__ANON__() called at /usr/share/perl5/Gtk3.pm line 572
eval {...} called at /usr/share/perl5/Gtk3.pm line 572
Gtk3::main("Gtk3") called at /usr/share/perl5/Shutter/Draw/DrawingTool.pm line 489
Shutter::Draw::DrawingTool::show(Shutter::Draw::DrawingTool=HASH(0x55b71fc9d690), "/home/greg/Pictures/Selection_147.png", "png", "image/png", "Selection_147", "", HASH(0x55b71c8a8100)) called at /usr/bin/shutter line 5826
Shutter::App::fct_draw(Gtk3::ImageMenuItem=HASH(0x55b71eb71b58)) called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Glib/Object/Introspection.pm line 67
eval {...} called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Glib/Object/Introspection.pm line 67
Glib::Object::Introspection::__ANON__(Shutter::App=HASH(0x55b71e070480)) called at /usr/bin/shutter line 10943

fct_update_tray_menu was called by Wnck::Screen=HASH(0x55b71eabd200)

Extra information, such as Shutter version, display server in use (Xorg or Wayland), operating system and ideas for how to solve:

I am using I3 Window Manager.

Linux gsp-laptop 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
greg@gsp-laptop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
greg@gsp-laptop:~$ apt show shutter
Package: shutter
Version: 0.99.2-4
Priority: optional
Section: universe/graphics
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 11.3 MB
Depends: gir1.2-ayatanaappindicator3-0.1, gir1.2-wnck-3.0, imagemagick, libcarp-always-perl, libfile-basedir-perl, libfile-copy-recursive-perl, libfile-which-perl, libglib-object-introspection-perl, libglib-perl, libgoocanvas2-cairotypes-perl, libgoocanvas2-perl, libgtk3-imageview-perl (>= 10), libgtk3-perl, libimage-exiftool-perl, libimage-magick-perl, libjson-maybexs-perl, libjson-perl, liblocale-gettext-perl, liblwp-protocol-https-perl, libnet-dbus-perl, libnet-dbus-glib-perl, libnet-oauth-perl, libnumber-bytes-human-perl, libpango-perl, libpath-class-perl, libproc-processtable-perl, libproc-simple-perl, libreadonly-perl, librsvg2-common, libsort-naturally-perl, libwww-mechanize-perl, libwww-perl, libx11-protocol-other-perl, libx11-protocol-perl, libxml-simple-perl, procps, xdg-utils
Suggests: nautilus-sendto
Homepage: https://shutter-project.org/
Download-Size: 1,182 kB
Photon89 commented 1 year ago

Updating fileinfos REJECTED for key: [2] - Selection_147.png (not modified)

I assume, you have no write permissions for the screenshot file. Could you please check it with

ls -l /home/greg/Pictures/Selection_147.png

gsperry2011 commented 1 year ago

That screenshot file is created by Shutter (when ran as my user) so I would presume that permissions on it would be correct. This issue occurs to all screenshots I take, shutter successfully writes the file.

-rw-rw-r-- 1 greg greg 14K Jan  4 12:56 ./Selection_147.png

Those permissions match other shutter generated screenshots from the past on my system:

greg@gsp-laptop:~/Pictures$ ls -lah ./Selection_001.png
-rw-rw-r-- 1 greg greg 46K Aug  3 15:13 ./Selection_001.png
Photon89 commented 1 year ago

That's weird... By the way, for me the permissions are -rw-r--r--, but I don't think this matters. Could you possibly test with a clean user?

gsperry2011 commented 1 year ago

Interestingly enough I do not run into this issue on a new user account on my system. I also verified under this new user that screenshot permissions are the same -rw-rw-r-- - Any idea how I can get this working under my user account?

Photon89 commented 1 year ago

You could try to move ~/.shutter to see, if it is some problem with Shutter's own configuration.

gsperry2011 commented 1 year ago

I took the lazy route, uninstalled shutter and then nuked ~/.shutter and sure enough everything is working as normal for me now. As far as I know I had no custom config and all was default. Thanks @Photon89 :+1: