phillbush / xmenu

a x11 menu utility
Other
296 stars 26 forks source link

Click & release #28

Closed hjpakgn closed 2 years ago

hjpakgn commented 3 years ago

Would it be possible to replicate the click & release behavior like in cwm menus? I would like to right/left click the mouse on the root window, move the mouse over the desired program and release to launch it. I guess this is already possible with xclickroot but if i release the mouse while not selecting an option the menu doesn't disappear. I found this https://git.z3bra.org/xmenu/log.html program that does exactly what I need but it's too simple for my needs.

PS: thanks for the awesome program

phillbush commented 3 years ago

I don't think it is possible to grab the pointer while a mouse button is being pressed.
I also tested jgmenu (another X11 menu), and it also fails to grab the pointer while a mouse button is pressed.

You can try it: Write jgmenu or xmenu on a terminal window, press the right mouse button on the root window and, while pressed, click enter (to pass the command on). jgmenu will exit with the message fatal: cannot grab pointer and xmenu will simply wait for the button to be released.

z3bra's xmenu works as expected because it can be run in daemon mode and has control of pressing and releasing. But my xmenu depends on xclickroot for that.
What you want to do is: make the right mouse button press be processed by xclickroot(1) and its release be processed by xmenu(1). I don't think that is possible.

hjpakgn commented 3 years ago

I understand. Maybe something like a daemon mode can be added to xmenu? I guess this would make running xmenu easier as there wouldn't be a dependency on xclickroot. I'd love to help with this but sadly my C skills are very basic, but I could try.

phillbush commented 3 years ago

I understand. Maybe something like a daemon mode can be added to xmenu?

I will implement a daemon mode.
It will be available in the next release.

nwwdles commented 3 years ago

It's possible to get click & release behavior by ungrabbing the pointer using xdotool key XF86Ungrab.

But enabling grab:break_actions option which is needed for this to work seems to be a security issue allowing to bypass the screensaver. Though you can probably disable the option every time you lock the screen.