summaryrefslogtreecommitdiff
path: root/openbox/actions
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/actions')
-rw-r--r--openbox/actions/all.c1
-rw-r--r--openbox/actions/all.h1
-rw-r--r--openbox/actions/iconify.c24
3 files changed, 26 insertions, 0 deletions
diff --git a/openbox/actions/all.c b/openbox/actions/all.c
index 3b1fb5fe..101cc75f 100644
--- a/openbox/actions/all.c
+++ b/openbox/actions/all.c
@@ -18,4 +18,5 @@ void action_all_startup()
action_lower_startup();
action_raiselower_startup();
action_unfocus_startup();
+ action_iconify_startup();
}
diff --git a/openbox/actions/all.h b/openbox/actions/all.h
index 69f2a589..0b6813eb 100644
--- a/openbox/actions/all.h
+++ b/openbox/actions/all.h
@@ -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
index 00000000..b82684ea
--- /dev/null
+++ b/openbox/actions/iconify.c
@@ -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;
+}