Created attachment 5212 patch As requested here http://wiki.xfce.org/plugins_wish_list#xfce-menu "xfce4-toggle-applicationsmenu script that could be mapped to a keyboard key to popup/hide the menu. Currently, xfce4-popup-applicationsmenu can be mapped to a key, but the menu needs to be closed using Esc key." The attached patch only works when doing this in the terminal: xfce4-toggle-applicationsmenu && sleep 1 && xfce4-toggle-applicationsmenu I don't know what prevents the hotkey toggling, it only gets called once, the second call, which would hide the menu, is ignored. I guess this is something related to 'panel_utils_grab_available'.
Created attachment 5473 Patch Patch updated. Inspecting the problem more thoroughly, it seems the problem is not related to applicationsmenu nor xfce4-panel remote event handling. If one runs something like "top -d 0.1 -o COMMAND" and press the hotkey which calls xfce4-toogle-applicationsmenu.sh, one will see a new process for the script spawning. If the key is pressed again, another process won't be spawned. I guess the problem is due xfsettingsd not getting keystrokes while the appmenu is open. I think it's because gtk_menu grabs the keyboard as described in this thread: https://mail.gnome.org/archives/gtk-app-devel-list/2007-February/msg00183.html
Just for the record, testing the whisker menu[1] I noticed that its xfce4-popup-whiskermenu script toggles the menu correctly... [1] http://gottcode.org/xfce4-whiskermenu-plugin/
Does the patch work for you? (sorry, I didn't have time to check it) I think modifying xfce4-popup-applicationsmenu to toggle the menu (like xfce4-popup-whiskermenu does) would work better - no need for two separate scripts and extra code in the plugin.
As Simon pointed me for this old bug, I agree with Andrzej, forget the patches and adopt the whiskermenu approach. Unfortunately do not expect me to handle this, as I don't use neither plugins anymore. Should we close this?
Yup, happy to close it for now if nobody is interested in the feature or working on it.