summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-22 14:35:51 +0000
committerDana Jansens <danakj@orodu.net>2007-06-22 14:35:51 +0000
commitcf478381b3e386dc0478403cf1a73b4d3ec6fa61 (patch)
tree00ae93df5b681333f375c13e48c89f304d943ea7
parentb0fa629769ef17cae28f137aad80f8c4798f7592 (diff)
add the iconify action
-rw-r--r--Makefile.am1
-rw-r--r--openbox/action.c7
-rw-r--r--openbox/actions/all.c1
-rw-r--r--openbox/actions/all.h1
-rw-r--r--openbox/actions/iconify.c24
5 files changed, 27 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 8f2c7aa0..03b94809 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 \
diff --git a/openbox/action.c b/openbox/action.c
index cf1ba86f..5393bb8a 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -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)
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;
+}