Don't close the menu when you held control even for execute
[dana/openbox.git] / openbox / actions / execute.c
index 376eee5..0e9e738 100644 (file)
@@ -33,7 +33,7 @@ static void     i_cancel_func(gpointer options);
 
 void action_execute_startup(void)
 {
-    actions_register("Execute", setup_func, free_func, run_func, NULL, NULL);
+    actions_register("Execute", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -43,27 +43,27 @@ static gpointer setup_func(xmlNodePtr node)
 
     o = g_new0(Options, 1);
 
-    if ((n = obt_parse_find_node(node, "command")) ||
-        (n = obt_parse_find_node(node, "execute")))
+    if ((n = obt_xml_find_node(node, "command")) ||
+        (n = obt_xml_find_node(node, "execute")))
     {
-        gchar *s = obt_parse_node_string(n);
+        gchar *s = obt_xml_node_string(n);
         o->cmd = obt_paths_expand_tilde(s);
         g_free(s);
     }
 
-    if ((n = obt_parse_find_node(node, "prompt")))
-        o->prompt = obt_parse_node_string(n);
+    if ((n = obt_xml_find_node(node, "prompt")))
+        o->prompt = obt_xml_node_string(n);
 
-    if ((n = obt_parse_find_node(node, "startupnotify"))) {
+    if ((n = obt_xml_find_node(node, "startupnotify"))) {
         xmlNodePtr m;
-        if ((m = obt_parse_find_node(n->children, "enabled")))
-            o->sn = obt_parse_node_bool(m);
-        if ((m = obt_parse_find_node(n->children, "name")))
-            o->sn_name = obt_parse_node_string(m);
-        if ((m = obt_parse_find_node(n->children, "icon")))
-            o->sn_icon = obt_parse_node_string(m);
-        if ((m = obt_parse_find_node(n->children, "wmclass")))
-            o->sn_wmclass = obt_parse_node_string(m);
+        if ((m = obt_xml_find_node(n->children, "enabled")))
+            o->sn = obt_xml_node_bool(m);
+        if ((m = obt_xml_find_node(n->children, "name")))
+            o->sn_name = obt_xml_node_string(m);
+        if ((m = obt_xml_find_node(n->children, "icon")))
+            o->sn_icon = obt_xml_node_string(m);
+        if ((m = obt_xml_find_node(n->children, "wmclass")))
+            o->sn_wmclass = obt_xml_node_string(m);
     }
     return o;
 }
@@ -169,9 +169,9 @@ static gboolean run_func(ObActionsData *data, gpointer options)
                 before = c + 4; /* 4 = strlen("$pid") */
             }
             else if ((c[1] == 'w' || c[1] == 'W') &&
-                (c[2] == 'i' || c[2] == 'I') &&
-                (c[3] == 'd' || c[3] == 'D') &&
-                !g_ascii_isalnum(c[4]))
+                     (c[2] == 'i' || c[2] == 'I') &&
+                     (c[3] == 'd' || c[3] == 'D') &&
+                     !g_ascii_isalnum(c[4]))
             {
                 /* found $wid */
                 gchar *tmp;
@@ -206,7 +206,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
     /* If there is a keyboard grab going on then we need to cancel
        it so the application can grab things */
-    event_cancel_all_key_grabs();
+    if (data->uact != OB_USER_ACTION_MENU_SELECTION)
+        event_cancel_all_key_grabs();
 
     e = NULL;
     if (!g_shell_parse_argv(cmd, NULL, &argv, &e)) {