]> Dogcows Code - chaz/openbox/commitdiff
bring back action_run_string,
authorDana Jansens <danakj@orodu.net>
Fri, 26 Sep 2003 18:02:39 +0000 (18:02 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 26 Sep 2003 18:02:39 +0000 (18:02 +0000)
use action_run_string for running actions from other actions

openbox/action.c
openbox/action.h

index 8a1a7d27cc4b2264052a97390ef7befe67844ec6..9d2554f5a1cdcb584a6f3fa6d07213bae3edf48b 100644 (file)
@@ -926,6 +926,20 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
     }
 }
 
+void action_run_string(const gchar *name, struct _ObClient *c)
+{
+    ObAction *a;
+    GSList *l;
+
+    a = action_from_string(name, OB_USER_ACTION_NONE);
+    g_assert(a);
+
+    l = g_slist_append(NULL, a);
+
+    action_run(l, c, 0);
+}
+
+void action_execute(union ActionData *data)
 {
     GError *e = NULL;
     char *cmd;
@@ -985,15 +999,7 @@ void action_raiselower(union ActionData *data)
         }
     }
 
-    if (raise) {
-        client_action_start(data);
-        stacking_raise(CLIENT_AS_WINDOW(c));
-        client_action_end(data);
-    } else {
-        client_action_start(data);
-        stacking_lower(CLIENT_AS_WINDOW(c));
-        client_action_end(data);
-    }
+    action_run_string((raise ? "Raise" : "Lower"), c);
 }
 
 void action_raise(union ActionData *data)
@@ -1005,26 +1011,18 @@ void action_raise(union ActionData *data)
 
 void action_unshaderaise(union ActionData *data)
 {
-    if (data->client.any.c->shaded) {
-        client_action_start(data);
-        client_shade(data->client.any.c, FALSE);
-        client_action_end(data);
-    } else {
-        client_action_start(data);
-        stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
-        client_action_end(data);
-    }
+    if (data->client.any.c->shaded)
+        action_run_string("Unshade", data->client.any.c);
+    else
+        action_run_string("Raise", data->client.any.c);
 }
 
 void action_shadelower(union ActionData *data)
 {
     if (data->client.any.c->shaded)
-        stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
-    else {
-        client_action_start(data);
-        client_shade(data->client.any.c, TRUE);
-        client_action_end(data);
-    }
+        action_run_string("Lower", data->client.any.c);
+    else
+        action_run_string("Shade", data->client.any.c);
 }
 
 void action_lower(union ActionData *data)
index f2ae7cbc1145cd06925a5cb6df74f4c67e9fc86d..bce741a6c794ff437ef543bee9964a796ba38c91 100644 (file)
@@ -209,6 +209,8 @@ void action_run_list(GSList *acts, struct _ObClient *c, ObFrameContext context,
 #define action_run(a, c, s) \
     action_run_list(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, FALSE, FALSE)
 
+void action_run_string(const gchar *name, struct _ObClient *c);
+
 /* Execute */
 void action_execute(union ActionData *data);
 /* ActivateAction */
This page took 0.03267 seconds and 4 git commands to generate.