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

index 8f2c7aa0d64d827068ca673604ac8cf69fffbb28..03b9480995a9b951bdfa5b0ce32243433ee9dc28 100644 (file)
@@ -163,6 +163,7 @@ openbox_openbox_SOURCES = \
        openbox/actions/execute.c \
        openbox/actions/exit.c \
        openbox/actions/focus.c \
+       openbox/actions/iconify.c \
        openbox/actions/lower.c \
        openbox/actions/move.c \
        openbox/actions/raise.c \
index cf1ba86fb672e1c769a0fd1843b668c887272fff..5393bb8a5935310122e5086b70351d08ac07afbd 100644 (file)
@@ -1010,13 +1010,6 @@ void action_run_string(const gchar *name, struct _ObClient *c, Time time)
     action_run(l, c, 0, time);
 }
 
-void action_iconify(union ActionData *data)
-{
-    client_action_start(data);
-    client_iconify(data->client.any.c, TRUE, TRUE, FALSE);
-    client_action_end(data, config_focus_under_mouse);
-}
-
 void action_unshaderaise(union ActionData *data)
 {
     if (data->client.any.c->shaded)
index 3b1fb5fe2fd576fe736870404a5aaec0dd271d6d..101cc75fc2cd0147cf0b385f43e480c461d492bb 100644 (file)
@@ -18,4 +18,5 @@ void action_all_startup()
     action_lower_startup();
     action_raiselower_startup();
     action_unfocus_startup();
+    action_iconify_startup();
 }
index 69f2a5891db06733d6e345a7ddde8e2c8fa4ca6a..0b6813eb0652ba6e1b8bb2dd497ba378207ca813 100644 (file)
@@ -19,5 +19,6 @@ void action_raise_startup();
 void action_lower_startup();
 void action_raiselower_startup();
 void action_unfocus_startup();
+void action_iconify_startup();
 
 #endif
diff --git a/openbox/actions/iconify.c b/openbox/actions/iconify.c
new file mode 100644 (file)
index 0000000..b82684e
--- /dev/null
@@ -0,0 +1,24 @@
+#include "openbox/actions.h"
+#include "openbox/client.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_iconify_startup()
+{
+    actions_register("Iconify",
+                     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);
+        client_iconify(data->client, TRUE, TRUE, FALSE);
+        actions_client_move(data, FALSE);
+    }
+
+    return FALSE;
+}
This page took 0.029042 seconds and 4 git commands to generate.