brisk-menu icon indicating copy to clipboard operation
brisk-menu copied to clipboard

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

Open jpleau opened this issue 6 years ago • 15 comments

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 <ALT>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?

jpleau avatar Apr 28 '18 18:04 jpleau

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 ?

TLogiviere avatar Apr 30 '18 16:04 TLogiviere

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.

Misko-2083 avatar May 04 '18 09:05 Misko-2083

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...

TLogiviere avatar May 04 '18 10:05 TLogiviere

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

ikeydoherty avatar May 06 '18 08:05 ikeydoherty

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.

Misko-2083 avatar May 06 '18 12:05 Misko-2083

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

vkareh avatar May 06 '18 12:05 vkareh

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'.

TLogiviere avatar May 06 '18 12:05 TLogiviere

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 avatar May 06 '18 14:05 vkareh

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.

vkareh avatar May 06 '18 14:05 vkareh

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 ^^

TLogiviere avatar May 06 '18 15:05 TLogiviere

@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:

  • KEY is pressed (for example Super_L)
  • Another action happens while KEY is still pressed (mouseclick, window action, etc)
  • KEY is released, nothing else happens

If I want to launch the overview

  • KEY is pressed (for example Super_L)
  • KEY is released, the overview opens

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

jpleau avatar May 13 '18 19:05 jpleau

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).

vkareh avatar May 13 '18 19:05 vkareh

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

Thanks!

jpleau avatar May 13 '18 22:05 jpleau

@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?

vkareh avatar May 24 '18 18:05 vkareh

Hi, sorry for the delay

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

Thanks!

jpleau avatar Jul 02 '18 01:07 jpleau