pop-os / shell

Pop!_OS Shell
GNU General Public License v3.0
4.86k stars 263 forks source link

Close Launcher on second invocation of custom shortcut #1168

Open titojankowski opened 3 years ago

titojankowski commented 3 years ago

Version: Pop OS 21.04

Current behavior: Opening and closing the Launcher requires the Super key in Pop 21.04. However, this keyboard shortcut isn't modifiable in the system "Keyboard Shortcuts" list.

Expected behavior: I would expect to be able to change the keyboard shortcut to open and close Launcher. i.e. instead of Super assign it to Ctr-Space to open and close.

Context: Since the Launcher key doesn't appear to be customizable, here's my partial workaround that introduces other issues.

I'm currently using the "Launch and switch applications" function (Launch+/). However, the downside is that pressing this same key combo doesn't exit the Launcher as it does with the Super key.

When using "Launch and switch applications" with the "calculator" function this is noticeable because after doing a calculation there's no way to exit besides hitting escape. It's also noticeable when attempting to open an application, and then not finding it or deciding against opening it. And then needing to hit escape to exit.

jacobgkau commented 3 years ago

Since other non-Super shortcuts close their respective menus when typed a second time (e.g. Super-A for Applications or Super-D for Workspaces), closing the Launcher if it's already open when the Launch and switch applications shortcut is typed seems like it would make sense.

mmstick commented 3 years ago

Unfortunately, the dialog captures all input from the super key, so it's not possible to trigger a shortcut with the launcher open.

jacobgkau commented 3 years ago

Could the launcher read what the shortcut's set to and listen for that shortcut itself? (I might be misunderstanding what "dialog" means in this context.)

mmstick commented 3 years ago

The launcher is a Shell.ModalDialog and it's consuming all keyboard and mouse input. So it intercepts all inputs, before the OS can even assign the inputs to shortcuts. I think it's possible to dynamically read that shortcut though. Just a bit complex.