summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-22 03:57:48 +0000
committerDana Jansens <danakj@orodu.net>2007-06-22 03:57:48 +0000
commit1b7e813c62a6e54690d15550d51ac4269e63f346 (patch)
tree0187eabee5053f09e22d2b73db2672fd2763520d
parent38268dc917ac9e59d9e8ef87825c9489ced77e95 (diff)
add the showdesktop action
-rw-r--r--Makefile.am1
-rw-r--r--openbox/action.c30
-rw-r--r--openbox/actions/all.c1
-rw-r--r--openbox/actions/all.h1
-rw-r--r--openbox/actions/debug.c7
-rw-r--r--openbox/actions/showdesktop.c21
-rw-r--r--openbox/actions/showmenu.c7
7 files changed, 24 insertions, 44 deletions
diff --git a/Makefile.am b/Makefile.am
index e66d9d4b..0529ecd7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -158,6 +158,7 @@ openbox_openbox_SOURCES = \
openbox/actions/all.h \
openbox/actions/debug.c \
openbox/actions/execute.c \
+ openbox/actions/showdesktop.c \
openbox/actions/showmenu.c \
openbox/actions.c \
openbox/actions.h \
diff --git a/openbox/action.c b/openbox/action.c
index 9b8653df..74a15620 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -776,21 +776,6 @@ ActionString actionstrings[] =
NULL
},
{
- "toggleshowdesktop",
- action_toggle_show_desktop,
- NULL
- },
- {
- "showdesktop",
- action_show_desktop,
- NULL
- },
- {
- "unshowdesktop",
- action_unshow_desktop,
- NULL
- },
- {
"desktoplast",
action_desktop_last,
NULL
@@ -1895,21 +1880,6 @@ void action_toggle_dockautohide(union ActionData *data)
dock_configure();
}
-void action_toggle_show_desktop(union ActionData *data)
-{
- screen_show_desktop(!screen_showing_desktop, NULL);
-}
-
-void action_show_desktop(union ActionData *data)
-{
- screen_show_desktop(TRUE, NULL);
-}
-
-void action_unshow_desktop(union ActionData *data)
-{
- screen_show_desktop(FALSE, NULL);
-}
-
void action_break_chroot(union ActionData *data)
{
/* break out of one chroot */
diff --git a/openbox/actions/all.c b/openbox/actions/all.c
index e0485ebe..077f394b 100644
--- a/openbox/actions/all.c
+++ b/openbox/actions/all.c
@@ -5,4 +5,5 @@ void action_all_startup()
action_execute_startup();
action_debug_startup();
action_showmenu_startup();
+ action_showdesktop_startup();
}
diff --git a/openbox/actions/all.h b/openbox/actions/all.h
index 13fbbd46..75cce788 100644
--- a/openbox/actions/all.h
+++ b/openbox/actions/all.h
@@ -6,5 +6,6 @@ void action_all_startup();
void action_execute_startup();
void action_debug_startup();
void action_showmenu_startup();
+void action_showdesktop_startup();
#endif
diff --git a/openbox/actions/debug.c b/openbox/actions/debug.c
index f219e059..bbc9cca2 100644
--- a/openbox/actions/debug.c
+++ b/openbox/actions/debug.c
@@ -8,13 +8,6 @@ typedef struct {
static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
static void free_func(gpointer options);
static gboolean run_func(ObActionsData *data, gpointer options);
-/*
-static gboolean i_input_func(guint initial_state,
- XEvent *e,
- gpointer options,
- gboolean *used);
-static void i_cancel_func(gpointer options);
-*/
void action_debug_startup()
{
diff --git a/openbox/actions/showdesktop.c b/openbox/actions/showdesktop.c
new file mode 100644
index 00000000..2699b1bc
--- /dev/null
+++ b/openbox/actions/showdesktop.c
@@ -0,0 +1,21 @@
+#include "openbox/actions.h"
+#include "openbox/screen.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_showdesktop_startup()
+{
+ actions_register("ShowDesktop",
+ NULL,
+ NULL,
+ run_func,
+ NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ screen_show_desktop(!screen_showing_desktop, NULL);
+
+ return FALSE;
+}
diff --git a/openbox/actions/showmenu.c b/openbox/actions/showmenu.c
index 6b6cbbe0..ec22de5b 100644
--- a/openbox/actions/showmenu.c
+++ b/openbox/actions/showmenu.c
@@ -8,13 +8,6 @@ typedef struct {
static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
static void free_func(gpointer options);
static gboolean run_func(ObActionsData *data, gpointer options);
-/*
-static gboolean i_input_func(guint initial_state,
- XEvent *e,
- gpointer options,
- gboolean *used);
-static void i_cancel_func(gpointer options);
-*/
void action_showmenu_startup()
{