solus-project / brisk-menu

An efficient menu for the MATE Desktop
GNU General Public License v2.0
139 stars 23 forks source link

brisk-menu causes Super to not be usable to move/resize windows in MATE #96

Open jpleau opened 6 years ago

jpleau commented 6 years ago

Hi.

brisk-menu 0.5.0-7ubuntu1

Fresh install of Ubuntu Mate 18.04. I configured the window manager to use "Super" instead of "Alt" so I can quickly resize and move windows by grabbing them and pressing "Super".

This doesn't work if I have "Super" configured to open up brisk-menu. Pressing "Super" and attempting to move/resize a window does nothing, but when I release the mouse, brisk-menu opens.

Ubuntu Mate 18.04 seems to contain the commits from #88 (as 1005_prevent_super_key_swallows_on_compiz.patch).

I tried working around this by configuring brisk-menu to use F1 as the shortcut, and using a program like "ksuperkey" to map the release of "Super_L" to "Alt+F1", but this doesn't work on my install (pressing Super_L does nothing, but pressing ALT+F1 works).

Any suggestions on how I could fix this?

TLogiviere commented 6 years ago

Hello, The same problem force to change i3wm and gnome-session(-flashback) modifier key to something else than Super_L or to change it for something less ergonomic. This is an issue as it prevents smooth integration in desktop environment using this key as main modifier. Would love to see Brisk-menu to let the event propagate if it don't know what to do with the key combination. One question though : how it happens that Brisk-menu is intercepting the key event before my window manager or gnome-session ?

Misko-2083 commented 6 years ago

Hi, I disabled the brisk menu hot-key, used ksuperkey to remap Super_L key release to "Ctrl+Shift+Escape" and set the "Ctrl+Shift+Escape" to run next script (requires xdotool): https://gist.github.com/Misko-2083/9d802269db03e118dc756598d0c33fce It's a little slow but works for me. :laughing: The brisk menu hot-key can be disabled with dconf-editor or via gsettings.

TLogiviere commented 6 years ago

Hello, Yup definitely a workaround :laughing: But it would be nice to get this otherwise nice software improved by releasing the event if it can't use it. I mean its what a peripheral software absolutely should do...

ikeydoherty commented 6 years ago

I don't see a bug here. You have super key bound for two actions and two things are fighting with it.

Misko-2083 commented 6 years ago

In Xfce4 there is a command that launches Whisker menu: xfce4-popup-whiskermenu It's a wrapper that runs a panel plugin

ATPOINTER=false
/usr/bin/xfce4-panel --plugin-event=whiskermenu:popup:bool:$ATPOINTER

I don't know if mate-panel can handle plugin events. Perhaps launching the brisk menu from a command line would be usefull in situations like this.

vkareh commented 6 years ago

A panel plugin won't solve the issue, as it still needs a global key binding for Super. The only thing I can think of at the moment is tracking mouse button presses on Brisk and cancelling the keypress listener when Super+Mouse-button-press happens.

Another thing that could improve compatibility would be to add a timeout, where if you press the Super key for longer than, say, 250ms, it also cancels the opening of the menu.

We already do both these things for mate-hud, which means I can use Alt+Click+Drag on windows, while still having the HUD bound to Alt

TLogiviere commented 6 years ago

What Misko suggests is to remove the binding in the conf of brisk-menu and create one within the session keybinding handler (in my case gsd-mediakeys) to open the menu. It could be a solution here, as gnome-session keybinder works well even if many shortcuts start with the same modifier, but it needs to be allowed by brisk-menu. Still, I don't get why the menu swallows 'Super+somekeys' even when it is only bonded to 'Super'.

vkareh commented 6 years ago

But it doesn't. If it swallows Super+OtherKey, that's a separate bug. It certainly doesn't affect me, so I wonder what could be causing that on your system?

vkareh commented 6 years ago

Also, I'm not sure we should have the mate-settings-daemon handling bindings for third-party apps, where do you draw the line there. We've made enough changes to both m-s-d and marco to support apps like Brisk et al having these types of keybindings, we shouldn't need to special-case them.

As I said, we've already fixed this for other apps that use the Alt key (which is harder than the Super key to account for), so my proposed solution should also be able to work for Brisk with the Super key.

TLogiviere commented 6 years ago

i3wm + gnome-session-flashback started by gdm (so no m-s-d running...) Anyway, I just switched to vala-panel which works well with this setup. Sorry jpleau for hijacking the issue, its all yours now ^^

jpleau commented 6 years ago

@ikeydoherty Then how do you explain in gnome-shell for example I can press Super to open the overview, but if I press Super and mouse-click a window the overview won't open and I can drag / resize my windows (and of course the overview doesn't open after I'm done with the windows)

I always had that behavior in most DE. In some cases is requires a bit of fiddling around (ksuperkey / xcape), for example with Xfce and Whiskermenu. But I didn't find a way to to do that with Brisk-menu in MATE that works correctly.

The way gnome-shell seems to do it is going by this logic:

If I want to drag a window:

If I want to launch the overview

Would something similar be possible? Detect between the key press and release if another action was initiated and cancel opening the menu if so?

vkareh commented 6 years ago

That's exactly what I proposed above. I just haven't had time to implement it for brisk. We did the same thing for Alt (which opens the mate HUD) and Alt+ClickDrag (which moves/resizes windows in Marco).

jpleau commented 6 years ago

@vkareh sorry I must have mis-read. Glad to hear it's on the table though, I'll keep an eye on this

Thanks!

vkareh commented 6 years ago

@ikeydoherty - I submitted a fix for this: #101

I've tested this using Compiz, Marco, and Metacity (there might be some edge cases on the latter, but it works). Have not tested on i3wm, as I've never been able to set it up properly without messing up my desktop.

@TLogiviere - Would you mind testing this on i3wm?

jpleau commented 6 years ago

Hi, sorry for the delay

@vkareh I just tested your fix, can confirm it works perfectly here! (On mate)

Thanks!