You are not logged in.

#1 2021-12-27 13:54:02

Furyspark
Member
Registered: 2021-12-27
Posts: 8

[SOLVED] GTK Applications and (global) keybinds during dragging

Ahoy!

I have an issue where keybinds don't seem to work while dragging files from a GTK-based application (afaik). I can't use alt-tab to switch windows while dragging something, for example.
The problem seems to happen with Thunar, Nautilus and File Roller, but not with Dolphin and Ark.

This seems like it could be a widespread issue, but I can barely find anything about it, and what I can find is from years ago, which makes me believe the issue might be local.
My laptop has the same issue, though, so I'm not entirely sure.

I'd appreciate any lights one might shed on this issue.

Last edited by Furyspark (2022-01-04 05:10:04)

Offline

#2 2021-12-27 14:13:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,361

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Wayland or X11?

Offline

#3 2021-12-27 15:22:43

Furyspark
Member
Registered: 2021-12-27
Posts: 8

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

I'm using X11. Also, I forgot to mention that it seems to happen on Plasma and Gnome (haven't tested other DEs). It's still X11 in both cases, according to the output of

echo $XDG_SESSION_TYPE

Offline

#4 2021-12-27 15:35:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,361

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Do other keys work?
I'd assume the dragging client might grab either the entire keyboard or the modifiers (ctrl, alt, shift) for special drag actions (what could lead to the misassumption that only global shortcuts are affected)

Offline

#5 2021-12-27 15:59:27

Furyspark
Member
Registered: 2021-12-27
Posts: 8

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Other keys don't seem to work either. Print screen (which is set to run a screenshot script) doesn't work while dragging, and neither does F1 to call Thunar or Nautilus' help function. Although with that last one, I'm not sure if it normally would call the help function while dragging. I'm just assuming with that one, admittedly.

Offline

#6 2021-12-27 16:25:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,361

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

setxkbmap -o "grab:break_actions"

shoudl™ allow you to break the grab (ctrl+alt+* or ctrl+alt+/ - the other one kills the grabbing client… I forgot which one was which)
If that allows you to use the system shortcuts during the drag you know the cause, but that's not a viable solution and there's probably some reason for the grab (albeit maybe a suboptimal implementation)

Edit: ffwi, using the DND demo from gtk-demo I can run global shortcuts (tried print for a scrot) fine (and the screengrabber will typically try to grab the keyboard)

Last edited by seth (2021-12-27 16:26:31)

Offline

#7 2021-12-27 16:52:47

Furyspark
Member
Registered: 2021-12-27
Posts: 8

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Just to be sure: did you mean to use `-option` instead of `-o`? Because for me, setxkbmap reported that -o is not an applicable argument.

Error!   Option "-o" not recognized

is the output, to be precise.

Unfortunately, after running that command using `-option` instead of `-o`, neither pressing ctrl+alt+* or ctrl+alt+/ during dragging seemed to have any effect.

Strangely enough, when I tried the DnD demo from gtk-demo, I was able to alt tab just fine during those drags, so it's not every GTK-based drag. The one thing I can say for sure (whether it'll be relevant or not) is that this faulty dragging happens with files, but not with random widgets, I suppose.

Offline

#8 2021-12-27 21:34:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,361

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Sorry, I somehow thought there was a short option.
I forgot that this only works w/ the */ keys on the numpad (and it's actually ctrl+alt+/ that breaks the grab)

The problem is likely the fileview widget (happens w/ geeqie too) and I tried: it does grab the entire keyboard and ctrl+alt+/ (I actually required my nose to enter that while holding the mouse button down ;-) released the grab and the global shortcuts would function as expected.
You probably want to alt+tab while dragging?

Offline

#9 2021-12-28 07:20:34

Furyspark
Member
Registered: 2021-12-27
Posts: 8

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Aye, I would really like to alt tab during drag operations.

I've also read somewhere a few weeks ago that clicking and holding down the left mouse button over a file, then alt tabbing to the other window, and only then start moving the mouse works, and it does, but it feels icky. tongue Plus, it's difficult to get used to.

Anyway, if you have more advice or anything for me to try out, please let me know.

Offline

#10 2021-12-28 08:13:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,361

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

If you have some sort of taskbar, it might respond to the dragenter/dragmove messages and activate windows for you.
Other than that and filing a bug against gtk to not grab the entire keyboard but only the relevant keys (escape, I guess) you could only add a shortcut dameon that uses xinput2/libinput/evdev that listens to the keyboard events on  a lower level and remote controls your WM via dbus or NETWM
The downside of the latter is that screensavers/lockers grab the keyboard to prevent exactly that from happening… (which is also why the grab releasing shortcuts of the X11 server are not enabled by default)

Offline

#11 2022-01-04 05:09:40

Furyspark
Member
Registered: 2021-12-27
Posts: 8

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Apologies for the late reply. I tinkered around a bit more, and found that I had set an environment variable in my .xprofile which caused these issues.

The variable in question (and the given value) was:

GDK_CORE_DEVICE_EVENTS=1

Hopefully this information will help another unfortunate soul sometime in the future.

Offline

#12 2022-01-04 08:24:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,361

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

I do have it as well. It used to be a mitigation against GTKs broken mousewheel handling, so you might want to check whether there're now issues w/ that (and otherwise be happy ;-)

Offline

#13 2022-01-04 17:47:34

Furyspark
Member
Registered: 2021-12-27
Posts: 8

Re: [SOLVED] GTK Applications and (global) keybinds during dragging

Aye, the comment I had above did suggest as much. So far I haven't noticed anything weird with GTK mousewheel handling, thankfully. I hope it stays that way, though. tongue Anyway, thanks for all the suggestions and patience!

Offline

Board footer

Powered by FluxBB