[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 81/473: Treat popup command as toggle. Closes #17.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:54:11 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 82ed7c3fdea41e2d665185c45d7042ac0032d9cc
Author: Graeme Gott <graeme at gottcode.org>
Date:   Thu Jul 11 10:45:24 2013 -0400

    Treat popup command as toggle. Closes #17.
---
 src/panel_plugin.cpp |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/panel_plugin.cpp b/src/panel_plugin.cpp
index 6ff652f..7b07350 100644
--- a/src/panel_plugin.cpp
+++ b/src/panel_plugin.cpp
@@ -267,12 +267,19 @@ void PanelPlugin::orientation_changed(bool vertical)
 
 gboolean PanelPlugin::remote_event(XfcePanelPlugin*, gchar* name, GValue* value)
 {
-	if (strcmp(name, "popup") || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_button)))
+	if (strcmp(name, "popup"))
 	{
 		return false;
 	}
 
-	popup_menu(value && G_VALUE_HOLDS_BOOLEAN(value) && g_value_get_boolean(value));
+	if (gtk_widget_get_visible(m_menu->get_widget()))
+	{
+		m_menu->hide();
+	}
+	else
+	{
+		popup_menu(value && G_VALUE_HOLDS_BOOLEAN(value) && g_value_get_boolean(value));
+	}
 
 	return true;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list