gnome-terminator / terminator

multiple GNOME terminals in one window
https://gnome-terminator.org
GNU General Public License v2.0
2.11k stars 257 forks source link

hide_window mapped with Shift+Control+Alt+$an_alphabet catches Control+Alt+$an_alphabet instead #509

Closed tomty89 closed 3 years ago

tomty89 commented 3 years ago

Describe the bug If the keymapping of hide_window is set to Shift+Control+Alt+$an_alphabet, the keystroke will be ignored andControl+Alt+$an_alphabet will be made to trigger hide_window instead. This occurs with (but most likely not limited to) the default Shift+Control+Alt+A and Shift+Control+Alt+H.

The problem appears to be hide_window specific. It does not occur with e.g. layout_launcher.

For the record, changing edit_tab_title away from Control+Alt+A (its default) does not make the problem go away.

Desktop (please complete the following information):

Vulcalien commented 3 years ago

Relevant code: (window.py, line 135)

self.hidebound = Keybinder.bind(
    self.config['keybindings']['hide_window'].replace('<Shift>',''),
    self.on_hide_window)

I experience this too, on GNOME (Debian)

tomty89 commented 3 years ago

@sboddy Could you provide any details about the commit?

Vulcalien commented 3 years ago

I don't think they work on Terminator anymore, that commit is 5 years old. It's supposed to fix the shift keys, I guess. However, if I remove the replace, it won't work at all. It might be an outdated library, or something has changed in these years.

tomty89 commented 3 years ago

It's odd that it's only a problem with hide_window though. Anyway, I guess we can/should at least change the default of hide_window to something else (e.g. Ctrl+Alt+H?) unless someone has a better fix. To be honest, this replace fix hardly makes senses anyway (it's literally worse than a FIXME comment...).

Vulcalien commented 3 years ago

I agree, the default should be different if we don't manage to fix this. hide_window is binded in an different way than all the other keybindings: it's a system-wide bind, because when the window is hidden, it must catch the keys even without focus. I'm reading the documentation, maybe I can see what we are doing wrong.

Edit: however the behavior is not the same on every system, I think.

Vulcalien commented 3 years ago

The best documentation I found is the comments in the code. They are pretty good.

From this:

"Cooked" accelerators use symbols produced by using modifiers such as shift or altgr, for example if "!" is produced by "Shift+1".

keybinder_set_use_cooked_accelerators

This seems connected to our problem.

Vulcalien commented 3 years ago

I made a patch to fix the issue. It should work as expected now, thanks for reporting the problem!

awvalenti commented 8 months ago

Hello. I just experienced this issue again:

Terminator was capturing my Ctrl Alt A usage from another app and executing hide_window, which was by default mapped to Ctrl Shift Alt A.

Ctrl Alt A was mapped by default to edit_tab_title.

I simply disabled both shortcuts for now.