Hello! The Wanderer has written on Tuesday, 29 April, at 11:29: >Is there a "toggling" version of the 'lxpanelctl menu' command, i.e., >one which will open the menu if it's closed and close it if it's open?
Well, do "toggling" in lxpanel is simple: diff --git a/src/plugins/menu.c b/src/plugins/menu.c index ee96c75..2901c55 100644 --- a/src/plugins/menu.c +++ b/src/plugins/menu.c @@ -66,6 +66,7 @@ typedef struct { gulong handler_id; int iconsize; gboolean has_system_menu; + gboolean menu_shown; guint show_system_menu_idle; Panel *panel; config_setting_t *settings; @@ -701,7 +702,11 @@ static gboolean show_system_menu_idle(gpointer user_data) menup* m = (menup*)user_data; if (g_source_is_destroyed(g_main_current_source())) return FALSE; - show_menu( m->img, m, 0, GDK_CURRENT_TIME ); + if (m->menu_shown) + gtk_menu_popdown(GTK_MENU(m->menu)); + else + show_menu( m->img, m, 0, GDK_CURRENT_TIME ); + m->menu_shown = !m->menu_shown; m->show_system_menu_idle = 0; return FALSE; } The problem is that once the menu is displayed it takes all the keyboard events so you cannot hide it again any other way but pressing 'Esc', the window manager will get no events because menu grabs keyboard ATM. And if you ungrab the keyboard from menu then you'll be unable to navigate menu by keyboard since menu will not receive events anymore, and I believe it is certainly not what you would ever want. I'm sorry. With best regards, Andriy. ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Lxde-list mailing list Lxde-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxde-list