add shadelower and unshaderaise actions back
authorDana Jansens <danakj@orodu.net>
Thu, 19 Jul 2007 20:00:59 +0000 (16:00 -0400)
committerDana Jansens <danakj@orodu.net>
Thu, 19 Jul 2007 20:00:59 +0000 (16:00 -0400)
Makefile.am
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/shadelowerraise.c [new file with mode: 0644]

index ba09d2e6cef3788d75677462d30062834badf4ac..b6db67992a3cb50ec75f0f8352028c5496acc100 100644 (file)
@@ -182,6 +182,7 @@ openbox_openbox_SOURCES = \
        openbox/actions/resizerelative.c \
        openbox/actions/restart.c \
        openbox/actions/shade.c \
+       openbox/actions/shadelowerraise.c \
        openbox/actions/showdesktop.c \
        openbox/actions/showmenu.c \
        openbox/actions/unfocus.c \
index 4b21e7e6f80b771643fe992a9863c1f7175b29af..de00d4ab5a3eba603245794beb63e9cce6ddd1fe 100644 (file)
@@ -37,4 +37,5 @@ void action_all_startup()
     action_movetoedge_startup();
     action_growtoedge_startup();
     action_focustobottom_startup();
+    action_shadelowerraise_startup();
 }
index 72324bb2fab468ea89ab7cee4e28cec1e44ae1ba..08fb8f47a53ea6772c1c5b2794f15bea4d00b1bd 100644 (file)
@@ -38,5 +38,6 @@ void action_layer_startup();
 void action_movetoedge_startup();
 void action_growtoedge_startup();
 void action_focustobottom_startup();
+void action_shadelowerraise_startup();
 
 #endif
diff --git a/openbox/actions/shadelowerraise.c b/openbox/actions/shadelowerraise.c
new file mode 100644 (file)
index 0000000..e9ba12d
--- /dev/null
@@ -0,0 +1,39 @@
+#include "openbox/actions.h"
+#include "openbox/client.h"
+
+static gboolean run_func_sl(ObActionsData *data, gpointer options);
+static gboolean run_func_ur(ObActionsData *data, gpointer options);
+
+void action_shadelowerraise_startup()
+{
+    actions_register("ShadeLower", NULL, NULL, run_func_sl, NULL, NULL);
+    actions_register("UnshadeRaise", NULL, NULL, run_func_ur, NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_sl(ObActionsData *data, gpointer options)
+{
+    if (data->client) {
+        actions_client_move(data, TRUE);
+        if (data->client->shaded)
+            stacking_lower(CLIENT_AS_WINDOW(data->client));
+        else
+            client_shade(data->client, TRUE);
+        actions_client_move(data, FALSE);
+    }
+    return FALSE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_ur(ObActionsData *data, gpointer options)
+{
+    if (data->client) {
+        actions_client_move(data, TRUE);
+        if (data->client->shaded)
+            client_shade(data->client, FALSE);
+        else
+            stacking_raise(CLIENT_AS_WINDOW(data->client));
+        actions_client_move(data, FALSE);
+    }
+    return FALSE;
+}