summaryrefslogtreecommitdiff
path: root/openbox/actions/shadelowerraise.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/actions/shadelowerraise.c')
-rw-r--r--openbox/actions/shadelowerraise.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/openbox/actions/shadelowerraise.c b/openbox/actions/shadelowerraise.c
new file mode 100644
index 00000000..1070a965
--- /dev/null
+++ b/openbox/actions/shadelowerraise.c
@@ -0,0 +1,40 @@
+#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()
+{
+ /* 3.4-compatibility */
+ 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;
+}