Add RaiseTemp action.
authorMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 21:41:10 +0000 (22:41 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Sat, 2 Feb 2008 19:37:52 +0000 (20:37 +0100)
This has the same effect as giving the <raise>yes</raise> option to next/prevwindow
but makes it optional and keybindable, so if W-Tab is nextwindow, you can have W-q
as raisetemp.

Makefile.am
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/raisetemp.c [new file with mode: 0644]

index d99fa30be050b31268e857e4e46c951c0b1cb455..a9421db228ed756b2335cafa8b4e22725a7d936d 100644 (file)
@@ -192,6 +192,7 @@ openbox_openbox_SOURCES = \
        openbox/actions/omnipresent.c \
        openbox/actions/raise.c \
        openbox/actions/raiselower.c \
+       openbox/actions/raisetemp.c \
        openbox/actions/reconfigure.c \
        openbox/actions/resize.c \
        openbox/actions/resizerelative.c \
index 47141ac6a65df57d31b1665c04ff9389b0d9c9de..0ac0dae487da54e64e00afc410c8f9eae2270efd 100644 (file)
@@ -15,6 +15,7 @@ void action_all_startup(void)
     action_move_startup();
     action_focus_startup();
     action_raise_startup();
+    action_raisetemp_startup();
     action_lower_startup();
     action_raiselower_startup();
     action_unfocus_startup();
index 5f3f573f247a967e3c1e19f3b5c85b29a8584b7b..6a3ef11dddf210af729d69aca8b646f9456b8cf1 100644 (file)
@@ -16,6 +16,7 @@ void action_close_startup();
 void action_move_startup();
 void action_focus_startup();
 void action_raise_startup();
+void action_raisetemp_startup();
 void action_lower_startup();
 void action_raiselower_startup();
 void action_unfocus_startup();
diff --git a/openbox/actions/raisetemp.c b/openbox/actions/raisetemp.c
new file mode 100644 (file)
index 0000000..ee667e9
--- /dev/null
@@ -0,0 +1,26 @@
+#include "openbox/actions.h"
+#include "openbox/stacking.h"
+#include "openbox/window.h"
+#include "openbox/focus_cycle.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_raisetemp_startup(void)
+{
+    actions_register("RaiseTemp",
+                     NULL, NULL,
+                     run_func,
+                     NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+    if (focus_cycle_target) {
+        actions_client_move(data, TRUE);
+        stacking_temp_raise(CLIENT_AS_WINDOW(data->client));
+        actions_client_move(data, FALSE);
+    }
+
+    return FALSE;
+}