[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/09: Fix unable to use custom commands with parameters.

noreply at xfce.org noreply at xfce.org
Sat Aug 20 18:34:23 CEST 2016


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

gottcode pushed a commit to annotated tag v1.2.2
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 126edc8435471ec6c37c3b0bc1cc043cc656f404
Author: Graeme Gott <graeme at gottcode.org>
Date:   Tue Nov 19 16:16:39 2013 -0500

    Fix unable to use custom commands with parameters.
---
 src/menu.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/menu.cpp b/src/menu.cpp
index 50625de..6fcaf3d 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -1006,9 +1006,18 @@ void Menu::check_command(Command& command, GtkWidget* button)
 {
 	if (command.m_status == Unchecked)
 	{
-		gchar* path = g_find_program_in_path(command.m_exec.c_str());
-		command.m_status = path ? Valid : Invalid;
-		g_free(path);
+		gchar** argv;
+		if (g_shell_parse_argv(command.m_exec.c_str(), NULL, &argv, NULL))
+		{
+			gchar* path = g_find_program_in_path(argv[0]);
+			command.m_status = path ? Valid : Invalid;
+			g_free(path);
+			g_strfreev(argv);
+		}
+		else
+		{
+			command.m_status = Invalid;
+		}
 	}
 	gtk_widget_set_sensitive(button, command.m_status == Valid);
 }

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


More information about the Xfce4-commits mailing list