phillbush / xmenu

a x11 menu utility
Other
296 stars 26 forks source link

xmenu doesn't stay open is border is set to 0 #46

Closed niels0n closed 1 year ago

niels0n commented 1 year ago

Hey, if I set the border to 0 in config.h, then if I right-click to open xmenu, as soon as I release the right button, the menu opens the entry which I had my cursor on, instead to stay open. Reverting the border to 1 fix this behaviour.

phillbush commented 1 year ago

That probably happens because the menu spawns with the first item right under the mouse cursor. So releasing the right button triggers this item. You can use the -r flag to disable the right button.

I think I can solve this issue by spawning the menu off the cursor position (say, 2 pixels to the bottom and right). Therefore it will achieve the same behavior as the border: avoid that the button release triggers a menu item.

niels0n commented 1 year ago

I'm trying to set -r but I'm having some troubles, I think I'm launching xmenu the wrong way. I have xclickroot -r /home/andrea/src/xmenu/xmenu.sh & in my .xinitrc. It works, but if I add -r before the & I get

X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 28 (X_GrabButton) Serial number of failed request: 7 Current serial number in output stream: 7

If I just do /home/andrea/src/xmenu/xmenu.sh -r it just opens xmenu like always, without the -r taking effect...so I obviously misunderstood something...

phillbush commented 1 year ago

The -r flag is a xmenu option, it should go into your /home/andrea/src/xmenu/xmenu.sh script in the invocation of xmenu itself.

niels0n commented 1 year ago

perfect, thanks