From 1b7e813c62a6e54690d15550d51ac4269e63f346 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 22 Jun 2007 03:57:48 +0000 Subject: [PATCH] add the showdesktop action --- Makefile.am | 1 + openbox/action.c | 30 ------------------------------ openbox/actions/all.c | 1 + openbox/actions/all.h | 1 + openbox/actions/debug.c | 7 ------- openbox/actions/showdesktop.c | 21 +++++++++++++++++++++ openbox/actions/showmenu.c | 7 ------- 7 files changed, 24 insertions(+), 44 deletions(-) create mode 100644 openbox/actions/showdesktop.c 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 @@ -775,21 +775,6 @@ ActionString actionstrings[] = action_toggle_dockautohide, NULL }, - { - "toggleshowdesktop", - action_toggle_show_desktop, - NULL - }, - { - "showdesktop", - action_show_desktop, - NULL - }, - { - "unshowdesktop", - action_unshow_desktop, - NULL - }, { "desktoplast", action_desktop_last, @@ -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() { -- 2.39.2