micheleg / dash-to-dock

A dock for the Gnome Shell. This extension moves the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops.
https://micheleg.github.io/dash-to-dock/
GNU General Public License v2.0
3.89k stars 461 forks source link

[Super shortcuts] Activation race between d-t-d and ubuntu-dock #648

Open franglais125 opened 7 years ago

franglais125 commented 7 years ago

@didrocks I moved the issue over here not to take over the other one. After all I'm not sure it's related.

As you probably found out:

This doesn't happen upon relogin, as ubuntu-dock doesn't get activated (with d-t-d installed).

I tested the name change for the shortcuts, and it works. There is a different warning, but at least it doesn't fail setting up the new shortcuts. Here is a sample output:

org.gnome.Shell.desktop[5724]: Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
org.gnome.Shell.desktop[5724]: Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
...

While I think this is a better user experience (for anyone installing dash-to-dock with ubuntu-dock already present), there is still one problem. Renaming the shortcuts implies having a different set of keys in the schema, and I don't know if you want to handle a separate compiled file, as you are already linking to the d-t-d one.

The other thing we could do is avoid deactivating the hotkeys from the conditional enablement in extension.js.

Something like (untested):

    // enable or disable dock depending on dock status and to_enable state
    if (to_enable && !dockManager) {
        dockManager = new Docking.DockManager();
    } else if (!to_enable && dockManager) {
        dockManager._keyboardShortcuts._hotKeysEnabled = false;
        dockManager.destroy();
        dockManager = null;
    }

Anyhow, just letting you know what my little investigation led me to!

PS: Just repeating the fact that this is only a problem right after the installation, and not that big an issue overall.

didrocks commented 7 years ago

While I think this is a better user experience (for anyone installing dash-to-dock with ubuntu-dock already present), there is still one problem. Renaming the shortcuts implies having a different set of keys in the schema, and I don't know if you want to handle a separate compiled file, as you are already linking to the d-t-d one.

Yeah, it seems adding a lot of complexity and maintainance cost for a small corner case. We explicitely wanted to keep the same keys so that advanced users can tweak their ubuntu dock settings via dash to dock one. I guess we can see how this issue is popular (and as you stated, it's only until the person restart the session after enabling d-t-d).

dockManager._keyboardShortcuts._hotKeysEnabled = false;

The issue with this is that it's called after dash to dock was initizialized, so I doubt it will fix the issue. Otherwise, we need to give ubuntu dock a way to trigger in dash to dock shortcut reinitialization, when we are in that else if case, wdyt?