! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Multiple instances with --region lock up
Status:
RESOLVED: FIXED
Product:
Xfce4-screenshooter
Component:
General

Comments

Description haarp 2013-07-18 16:37:20 CEST
Running multiple instances with the --region option (e.g. through a keyboard shortcut) will darken the screen further and lock the desktop. No more mouse clicks are accepted until the screenshooters are killall'ed from a VT.
Comment 1 Shuhao 2013-11-17 18:52:04 CET
Confirmed. +1
Comment 2 GRbit 2014-09-22 18:30:48 CEST
Affects me too +1
Comment 3 Yan Pas 2014-09-24 23:52:49 CEST
Mee too. The workaround is CTRL+ALT+F1. Login into your account. killall xfce4-screenshooter. Enter this command till you get message that all instaces are closed
Comment 4 Landry Breuil editbugs 2015-02-11 21:42:35 CET
I cant reproduce it here with 1.8.2, with and without compositing activated. If i bind a key to xfce4-screenshooter -r and press it several times, the screenshooter is only started once, and pressing escape allows me to exit it.

Can everyone retry with 1.8.2 ?
Comment 5 haarp 2015-02-11 21:47:43 CET
$ xfce4-screenshooter -V
xfce4-screenshooter 1.8.2

Problem is still present for me :/
Comment 6 Landry Breuil editbugs 2015-02-11 22:09:06 CET
What if you exit with escape ?
Comment 7 GRbit 2015-02-12 00:39:00 CET
No escape key doesn't help, only if switch to console Alt+Ctrl+F1 and killall xfce4-screenshooter

Just make a hotkey with xfce4-screenshooter -r and press it two times in a row, the you'll see
Comment 8 Landry Breuil editbugs 2015-02-12 09:01:47 CET
(In reply to GRbit from comment #7)
> Just make a hotkey with xfce4-screenshooter -r and press it two times in a
> row, the you'll see

That's exactly what i did, and it doesnt seem to launch multiple instances. So that might be a combinaison of *other* parameters. Since i cant reproduce here, i'm afraid you'll have to build the screenshooter with DEBUG_TRACE set to 1 in config.h, and try to debug it yourself looking at your session's stderr log.
Comment 9 haarp 2015-02-12 13:50:53 CET
(In reply to Landry Breuil from comment #8)
> (In reply to GRbit from comment #7)
> > Just make a hotkey with xfce4-screenshooter -r and press it two times in a
> > row, the you'll see
> 
> That's exactly what i did, and it doesnt seem to launch multiple instances.
> So that might be a combinaison of *other* parameters. Since i cant reproduce
> here, i'm afraid you'll have to build the screenshooter with DEBUG_TRACE set
> to 1 in config.h, and try to debug it yourself looking at your session's
> stderr log.

Did that. I started two instances of screenshooter with DEBUG_TRACE enabled. Both instances show the SAME log:

TRACE[lib/screenshooter-utils.c:70] screenshooter_read_rc_file(): Open the rc file
TRACE[lib/screenshooter-utils.c:76] screenshooter_read_rc_file(): Read the entries
TRACE[lib/screenshooter-utils.c:98] screenshooter_read_rc_file(): Close the rc file
TRACE[lib/screenshooter-utils.c:105] screenshooter_read_rc_file(): Set the values of the struct
TRACE[lib/screenshooter-capture.c:1100] screenshooter_take_screenshot(): Let the user select the region to screenshot
TRACE[lib/screenshooter-capture.c:511] cb_expose(): Expose event received.
TRACE[lib/screenshooter-capture.c:511] cb_expose(): Expose event received.


As soon as the second instance is started, neither of them reacts to anything anymore.
Comment 10 GRbit 2015-02-12 14:04:59 CET
(In reply to Landry Breuil from comment #8)
> (In reply to GRbit from comment #7)
> > Just make a hotkey with xfce4-screenshooter -r and press it two times in a
> > row, the you'll see
> 
> That's exactly what i did, and it doesnt seem to launch multiple instances.
> So that might be a combinaison of *other* parameters. Since i cant reproduce
> here, i'm afraid you'll have to build the screenshooter with DEBUG_TRACE set
> to 1 in config.h, and try to debug it yourself looking at your session's
> stderr log.

I am not so advanced, but I've downloaded a new Xubuntu distro 14.04.1
There is new xfce4-screenshooter 1.8.1 and I can reproduce the bug 

So, now you can reproduce the bug by yourself)
Comment 11 haarp 2015-02-12 14:06:21 CET
Update: Under some conditions (see bug 10260), screenshooter still reacts to the Esc key. Here's what happens:

- Open 2 terminals
- In terminal 1: sleep 5; xfce4-screenshooter -r
- In terminal 2: xfce4-screenshooter -r
- Wait
-> Two screenshooters are active
- Press Esc
-> screenshooter from terminal 2 terminates
- Press Esc again
-> screenshooter from terminal 1 does NOT react
Comment 12 Yan Pas 2015-02-12 14:47:13 CET
I use shortcut ctrl + prtscr. And the bug is reproducible
Comment 13 Landry Breuil editbugs 2015-02-12 15:22:35 CET
Adding a +1 or just saying that you can reproduce it is *worthless* if you dont specify which version you're running (the last version is 1.8.2), what settings you have configured in .config/xfce4/xfce4-screenshooter, and whether compositing is enabled or not.

The codepaths used to handle keyboard events are not the same if compositing is on or off, and we can't guess what setups you guys are running....
Comment 14 haarp 2015-02-12 15:29:18 CET
All my tests were with compositing on. 

(Switching it off makes it so the multiple instances don't lock up everything else, but they still run.)
Comment 15 GRbit 2015-02-12 23:17:57 CET
(In reply to Landry Breuil from comment #13)
> Adding a +1 or just saying that you can reproduce it is *worthless* if you
> dont specify which version you're running (the last version is 1.8.2), what
> settings you have configured in .config/xfce4/xfce4-screenshooter, and
> whether compositing is enabled or not.
> 
> The codepaths used to handle keyboard events are not the same if compositing
> is on or off, and we can't guess what setups you guys are running....

Just load latest xubuntu LiveCD and I can assure you, reproduce the problem will be very easy. You can check any config file, any settings, anything you want.
Comment 16 wolf 2016-12-11 22:46:59 CET
$ pacman -Qs screenshooter
local/xfce4-screenshooter 1.8.2-3 (xfce4-goodies)

$ cat ~/.config/xfce4/xfce4-screenshooter 
delay=0
region=3
action=1
show_mouse=0
screenshot_dir=file:///home/user/Pictures
app=none
last_user=

Settings Manager > Window Manager Tweaks > Compositor > Enable display compositing - is on 

Mapped `xfce4-screenshooter -r` to a keyboard shortcut, and can press it multiple times to make the screen progressively darker. Not sure if the issue is that multiple instances shouldn't be allowed to run at once, or more likely, the issue is that there is no way to quit the tool when it's run from a shortcut: https://bugzilla.xfce.org/show_bug.cgi?id=10260 It might be possible to quit out of each instance if the Esc key for quit worked on each instance.
Comment 17 gbr 2017-05-20 09:48:29 CEST
Here's a workaround: https://gist.github.com/GUiHKX/a85936ebc62c3f777362d0ef3a59322a
Comment 18 Landry Breuil editbugs 2017-05-21 09:01:37 CEST
Does this still happen with the Gtk3 version ?
Comment 19 Andre Miranda editbugs 2017-05-22 14:21:39 CEST
Sort of no. Multiple instances still stack up and only the last is dismissed on esc, maybe the other ones lose the keyboard grab. However I'm able to dismiss all remaining instances by selecting a region, unless alt+tab is used to switch windows. I can only think of two solutions: Use GtkApplication's single-instance feature (easy) or try to reason about the mess of devices grab to find a non-hackish solution for this (not guaranteed nor really fun). If the single-instance isn't a problem I can add this feature to the Gtk3 version.
Comment 20 Landry Breuil editbugs 2017-05-22 14:34:50 CEST
Using a single-instance makes sense to me, i hardly see how one would want to take two screenshots simultaneously using two pointing devices....
Comment 21 Andre Miranda editbugs 2017-05-24 19:48:51 CEST
Created attachment 7117 
Single instance patch

Here is the patch using GtkApplication, similar to what I used in bug #11169.
Single instance is working as expected, but the region overlay can't be dismissed when xfce4-screenhooter -r is invoked by a global hotkey, there's bug for that already: bug #10260.
Comment 22 Git Bot editbugs 2018-03-06 17:42:27 CET
Andre Miranda referenced this bugreport in commit 76f54a331ff889d928148f9f636de8b869ce27e4

Handle device grab failure (Bug #10259)

https://git.xfce.org/apps/xfce4-screenshooter/commit?id=76f54a331ff889d928148f9f636de8b869ce27e4
Comment 23 Andre Miranda editbugs 2018-03-06 17:44:45 CET
That commit fixes this and bug #10260.
Comment 24 haarp 2018-03-08 13:01:09 CET
(In reply to Andre Miranda from comment #21)
> Created attachment 7117 
> Single instance patch
> 
> Here is the patch using GtkApplication, similar to what I used in bug #11169.
> Single instance is working as expected, ...

This patch seems to be working aswell. Thanks :)

Bug #10259

Reported by:
haarp
Reported on: 2013-07-18
Last modified on: 2018-03-08

People

Assignee:
Jérôme Guelfucci
CC List:
8 users

Version

Version:
unspecified

Attachments

Single instance patch (3.00 KB, patch)
2017-05-24 19:48 CEST , Andre Miranda
no flags

Additional information