]> Dogcows Code - chaz/openbox/commitdiff
add lower and raiselower actions
authorDana Jansens <danakj@orodu.net>
Fri, 22 Jun 2007 14:28:21 +0000 (14:28 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 22 Jun 2007 14:28:21 +0000 (14:28 +0000)
Makefile.am
openbox/action.c
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/lower.c [new file with mode: 0644]
openbox/actions/raiselower.c [new file with mode: 0644]

index cebec4076f21cf16256f7c01a079b89f1d9e77c5..b59fdd34a265cce4f930a9d2fcebf26a4434268e 100644 (file)
@@ -163,8 +163,10 @@ openbox_openbox_SOURCES = \
        openbox/actions/execute.c \
        openbox/actions/exit.c \
        openbox/actions/focus.c \
+       openbox/actions/lower.c \
        openbox/actions/move.c \
        openbox/actions/raise.c \
+       openbox/actions/raiselower.c \
        openbox/actions/reconfigure.c \
        openbox/actions/restart.c \
        openbox/actions/showdesktop.c \
index f0fe691e733d55d03a2391d75feafc1a6b294fb8..a56f4cb4854819b104e30133c6ba8e2828d5847f 100644 (file)
@@ -464,16 +464,6 @@ ActionString actionstrings[] =
         action_focus_order_to_bottom,
         setup_client_action
     },
-    {
-        "raiselower",
-        action_raiselower,
-        setup_client_action
-    },
-    {
-        "lower",
-        action_lower,
-        setup_client_action
-    },
     {
         "kill",
         action_kill,
@@ -1048,15 +1038,6 @@ void action_focus_order_to_bottom(union ActionData *data)
     focus_order_to_bottom(data->client.any.c);
 }
 
-void action_raiselower(union ActionData *data)
-{
-    ObClient *c = data->client.any.c;
-
-    client_action_start(data);
-    stacking_restack_request(c, NULL, Opposite);
-    client_action_end(data, config_focus_under_mouse);
-}
-
 void action_unshaderaise(union ActionData *data)
 {
     if (data->client.any.c->shaded)
@@ -1073,13 +1054,6 @@ void action_shadelower(union ActionData *data)
         action_shade(data);
 }
 
-void action_lower(union ActionData *data)
-{
-    client_action_start(data);
-    stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
-    client_action_end(data, config_focus_under_mouse);
-}
-
 void action_kill(union ActionData *data)
 {
     client_kill(data->client.any.c);
index 4bc4814a7b59f33e8420cc483f5a87427131a999..c4edc5c345db1f2d960ffb4d9f04599b838d3a19 100644 (file)
@@ -15,4 +15,6 @@ void action_all_startup()
     action_move_startup();
     action_focus_startup();
     action_raise_startup();
+    action_lower_startup();
+    action_raiselower_startup();
 }
index 01716e39e9c95405106bbda7b1faa3f89907a424..48b6d1c13796bf1efc433bc7b2f278c3b73b574b 100644 (file)
@@ -16,5 +16,7 @@ void action_close_startup();
 void action_move_startup();
 void action_focus_startup();
 void action_raise_startup();
+void action_lower_startup();
+void action_raiselower_startup();
 
 #endif
diff --git a/openbox/actions/lower.c b/openbox/actions/lower.c
new file mode 100644 (file)
index 0000000..1abf590
--- /dev/null
@@ -0,0 +1,24 @@
+#include "openbox/actions.h"
+#include "openbox/stacking.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_lower_startup()
+{
+    actions_register("Lower",
+                     NULL, NULL,
+                     run_func,
+                     NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+    if (data->client) {
+        actions_client_move(data, TRUE);
+        stacking_lower(CLIENT_AS_WINDOW(data->client));
+        actions_client_move(data, FALSE);
+    }
+
+    return FALSE;
+}
diff --git a/openbox/actions/raiselower.c b/openbox/actions/raiselower.c
new file mode 100644 (file)
index 0000000..f75410a
--- /dev/null
@@ -0,0 +1,24 @@
+#include "openbox/actions.h"
+#include "openbox/stacking.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_raiselower_startup()
+{
+    actions_register("RaiseLower",
+                     NULL, NULL,
+                     run_func,
+                     NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+    if (data->client) {
+        actions_client_move(data, TRUE);
+        stacking_restack_request(data->client, NULL, Opposite);
+        actions_client_move(data, FALSE);
+    }
+
+    return FALSE;
+}
This page took 0.033599 seconds and 4 git commands to generate.