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 ba09d2e..b6db679 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 4b21e7e..de00d4a 100644 (file)
@@ -37,4 +37,5 @@ void action_all_startup()
     action_movetoedge_startup();
     action_growtoedge_startup();
     action_focustobottom_startup();
+    action_shadelowerraise_startup();
 }
index 72324bb..08fb8f4 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;
+}