Shutter fails to detect active window

Bug #1418149 reported by Mindaugas Jakutis
72
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Shutter
New
Undecided
Unassigned

Bug Description

Scenario 1: there's a single window in the workspace and it is active.

Running `shutter -c -d 3 -a` for the first time works as expected.

However, repeating the command again (with shutter still running) fails to detect the (same) active window correctly:
error message window 'no window with name pattern shutter detected' is displayed

Scenario 2: there are more than one window in the workspace. Last of them is active.

Running `shutter -c -d 3 -a` for the first time works as expected.

However, repeating the command again (with shutter still running) fails to detect the (same) active window correctly:
shutter focuses and captures what appears to be first window in the workspace (even if it was not active initially)

additional console output in scenario 2: 'Exiting eval via last at /usr/share/shutter/resources/modules/Shutter/Screenshot/WindowName.pm line 75.'

shutter 0.93.1 Rev.1278
3.16.7.4-1-MANJARO x86_64 (64 bit gcc: 4.9.2)
Desktop: LXDE (Openbox 3.5.2, lxpanel 0.8.0)
X.Org 1.16.3, Mesa 10.4.2

Revision history for this message
Harrison (werewaltz) wrote :

I replaced the default printscreen function command with 'shutter --active'. It pretty much works the same way as the author of the bug report described. For the profile settings, I use the filename: 'ToS_%NNN' and have it correctly save in a valid path.

I am a big fan of the feature not copying to clipboard. I tried the other settings but still end up as the same result.

From observation, it seems as though its buffering the image inside the shutter program itself instead of automatically being saved to the folder specified. When taking the screenshot, the shutter icon in the task panel momentarily disappears but then reappears after screenshot either succeeded or failed.

When it fails, it produces the error message "No window with name pattern 'shutter' detected" with the error title being: 'Error while taking the screenshot.' When it fails it just crashes shutter it seems.

It is weird that it worked fine in previous versions of shutter.

Shutter 0.93.1 Rev.1278
Linux mint 17.1 x86_64
Desktop: KDE

Revision history for this message
random (jskosbjyrxqo) wrote :

I didn't have this issue under KDE4, but after an upgrade to fedora 22 with KDE5 and adding a global shortcut 'shutter -a' I get the failed to detect error. Interestingly, running shutter -a from a terminal works just fine. Perhaps something to do with the environment the global shortcut gets executed in?

Revision history for this message
nicholas (nicholas-alipaz) wrote :

I was able to work around the issue by changing my keybinding to use `shutter -w` which allows selecting the window to screenshot by clicking on it. Not as fluid as active window would be but at least I can easily take a screenshot of a particular window now.

Revision history for this message
Pastafarianist (pastafarianist) wrote :

There is a problem with -w: it can't detect a full screen window of Chrome. Furthermore, under KDE, it draws window titles in incorrect encodings, but I guess that's a GTK or Qt issue.

This got broken after I upgraded from 0.90 to 0.93.1. Before, shutter could capture active windows just fine (but occasionally freezed after being launched with a shortcut, sometimes to the point that I had to pkill it).

Revision history for this message
Andreas Wehler (andreas-wehler) wrote :

I've defined a Keyboard Macro for "Shift-Print" to launch "shutter --active".

First call is ok.
Second time varies:
  a) First time is ok.
  b) Second and other time varies.
    b1) mostly: wrong window taken.
    b2) or: 'no window with name pattern shutter detected' # ?? It was just an active "Terminal" window.
  c) Launch via terminal is ok
  d) If Shutter is terminated via "Quit" button then the next time will be is the first time, it's ok again.
     Therefore this is a valid workaround: You may quit shutter also with Ctrl-Q in case it was the wrong window
     and redo the snapshot again.

Xubuntu 15.04; XFCE
shutter --version
defined(@array) is deprecated at /usr/bin/shutter line 3727.
 (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /usr/bin/shutter line 3738.
 (Maybe you should just omit the defined()?)
WARNING: gnome-web-photo is missing --> screenshots of websites will be disabled!

WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!

0.92 Rev.1269

Revision history for this message
Pastafarianist (pastafarianist) wrote :

I haven't seen this bug under 0.91, but have seen it multiple times under 0.93.1. Therefore, the problem is somewhere in https://bazaar.launchpad.net/~mario-kemper/shutter/devel/revision/1278?remember=1260&compare_revid=1260#bin/shutter

Revision history for this message
Pastafarianist (pastafarianist) wrote :

Correction: it also shows up in 0.92 (rev 1269).

https://bazaar.launchpad.net/~mario-kemper/shutter/devel/revision/1269?remember=1260&compare_revid=1260#bin/shutter

I don't know anything about the internals of Shutter, but maybe line 328 in rev 1269 contains the bug?

Revision history for this message
Andreas Wehler (andreas-wehler) wrote :

Hi.

SUCCESS!

Ubuntu 16.04; shutter 0.93.1 Rev.1278

@random seems to be right. Keyboard shortcut may be wrapped within a separate bash, then it works:

Shortcut for Shift+Print

# This fails:
shutter --active

# This works:
bash -c "shatter --active"

Have fun!

Thanks for he great shutter, Andreas

Revision history for this message
Andreas Wehler (andreas-wehler) wrote :

Hi.

Ok, 2nd time shutter will not find a window with pattern "shutter".
So, it's a bit tricky, but this finally works:

# Shortcut for Shift+Print
bash -c "pkill shutter ; shutter --active"

# Keep in mind to adjust shutter preferences as needed,
# e.g. (see screenshot).

  Andreas

Revision history for this message
Doug Rohm (drohm) wrote :

@andreas-wehler, you're workaround works perfectly for me. Hopefully this can get fixed in the next version.

Doug

Revision history for this message
ineuw (ineuw) wrote :

I am getting "No window with name pattern 'shutter' detected", but the solution bash -c "shutter --active" doesn't work. Installation was a couple of days ago from the repositor.

I am using shutter 0.93.1 Rev.1278
System: Host: maccin18 Kernel: 4.4.0-62-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: Cinnamon 3.2.7 (Gtk 3.18.9-1ubuntu3.1) dm: mdm Distro: Linux Mint 18.1 Serena

Revision history for this message
elviseftv (elvis.eftv) wrote :

For me the issue is that with bash -c "shutter --active" it only takes a screenshot of my browser (chromium) window. It's weird. Terminal commands work like a charm. Even menu items work as expected. But the keys shortcut option not.

My system is:
===============
Linux eftvlap 3.16.0-4-686-pae #1 SMP Debian 3.16.39-1+deb8u1 (2017-02-22) i686 GNU/Linux

Distributor ID: Debian
Description: Debian GNU/Linux 8.7 (jessie)
Release: 8.7
Codename: jessie

Shutter version: 0.92 Rev.1269
===============

The terminal shows me also a couple of notices or errors:

defined(@array) is deprecated at /usr/bin/shutter line 3727.
 (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /usr/bin/shutter line 3738.
 (Maybe you should just omit the defined()?)

and lot kind of these:

GLib-GObject-WARNING **: /build/glib2.0-3vWc1h/glib2.0-2.42.1/./gobject/gsignal.c:2461: signal 'child-added' is invalid for instance '0xacab070' of type 'GtkMenu' at /usr/lib/i386-linux-gnu/perl5/5.20/Gtk2/AppIndicator.pm line 177, <DATA> line 19.

Revision history for this message
Olavo Lucena (olavo-lucena) wrote :

here's the solution:
my linux distribution is: Linux Mint xfce 19.3

1) install the application: scrot (Linux command-line screenshot)
in the terminal type:
sudo apt install scrot
or at the application manager search for scrot and install it

2)at the application manager search for the keyboard settings editor and in the application shortcuts tab, click the add button and paste the command:
scrot '/tmp/image_%F_%T.png' --focused --exec 'shutter $f'
click the ok button and then choose the key or shortcut key combination(see attached screenshot "keyboard shortcut.png"). You can change the /tmp folder to a different folder to save the screenshots.

here it worked perfectly!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.