lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.27k stars 162 forks source link

Gnome's window manager eats the keypress event #393

Closed ghost closed 4 years ago

ghost commented 5 years ago

After installing a fresh Fedora 30 (was using 29 before), now gnome is eating the keyboard events nothing gets to tilda and it wont reappear. Unless focus is on a non-gnome-native application such as chrome or Firefox. For instance when the focus is on file-roller, F1 would lunch help. But right now as I'm writing in Firefox, F1 will easily lunch tilda.

There is a gnome-shell extension called drop-down-terminal and in it's js code it uses the code below, but going through the gnome source I couldn't find where Main.wm.addKeybinding is implemented (actually I couldn't figure out which project it is in their zillion billion projects on their Gitlab page).

I updated tomboykeybinder.c and tomboykeybinder.h to their latest version but no luck. I changed XGrabKey to XGrabKeyboard as suggested by some, and yes it opens tilda but you can't type anything. XGrabKeyboard doesn't have a very nice documentation.

Is it possible to signal tilda to show? using SIG_something, or d-bus, or ...?

    _bindShortcut: function() {                                                 
        if (Main.wm.addKeybinding && Shell.ActionMode) // introduced in 3.16    
            Main.wm.addKeybinding(REAL_SHORTCUT_SETTING_KEY, this._settings, Meta.KeyBindingFlags.NONE,
                                  Shell.ActionMode.NORMAL | Shell.ActionMode.MESSAGE_TRAY,
                                  Lang.bind(this, this._toggle));               
        else if (Main.wm.addKeybinding && Shell.KeyBindingMode) // introduced in 3.7.5
            Main.wm.addKeybinding(REAL_SHORTCUT_SETTING_KEY, this._settings, Meta.KeyBindingFlags.NONE,
                                  Shell.KeyBindingMode.NORMAL | Shell.KeyBindingMode.MESSAGE_TRAY,
                                  Lang.bind(this, this._toggle));               
        else if (Main.wm.addKeybinding && Main.KeybindingMode) // introduced in 3.7.2
            Main.wm.addKeybinding(REAL_SHORTCUT_SETTING_KEY, this._settings, Meta.KeyBindingFlags.NONE,
                                  Main.KeybindingMode.NORMAL | Main.KeybindingMode.MESSAGE_TRAY,
                                  Lang.bind(this, this._toggle));               
        else                                                                    
            global.display.add_keybinding(REAL_SHORTCUT_SETTING_KEY, this._settings, Meta.KeyBindingFlags.NONE,
                                          Lang.bind(this, this._toggle));       

    },                             

My system: Fedora 30 (fully updated)

$ uname -a
Linux **** 5.1.15-300.fc30.x86_64 #1 SMP Tue Jun 25 14:07:22 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
`
`
$ dnf list installed | grep gnome
gnome-desktop3.x86_64                            3.32.2-1.fc30
gnome-session.x86_64                             3.32.0-1.fc30
gnome-session-wayland-session.x86_64             3.32.0-1.fc30
gnome-session-xsession.x86_64                    3.32.0-1.fc30
gnome-settings-daemon.x86_64                     3.32.1-1.fc30
gnome-shell.x86_64                               3.32.2-2.fc30
gnome-tweaks.noarch                              3.32.0-2.fc30
libgnomekbd.x86_64                               3.26.1-1.fc30
lanoxx commented 5 years ago

Hi,

The problem you describe comes from the fact that tilda only works on X11 while Fedora probably switched to Wayland. Under wayland tilda can start via an XWayland wrapper but then it will only receive keyboard shortcuts when another X application is active such as Firefox.

Ideally at some point tilda needs to get a backend for wayland but that is not going to happen soon.

Tilda currently has no support tor dbus or signals but would be possible to add that.

ghost commented 4 years ago

Closing this one in favour of https://github.com/lanoxx/tilda/pull/396