1 #include "openbox/actions.h"
2 #include "openbox/screen.h"
5 /* If true, windows are unable to be shown while in the showing-desktop
10 static gpointer
setup_func(xmlNodePtr node
);
11 static void free_func(gpointer o
);
12 static gboolean
run_func(ObActionsData
*data
, gpointer options
);
14 void action_showdesktop_startup(void)
16 actions_register("ToggleShowDesktop", setup_func
, free_func
, run_func
);
19 static gpointer
setup_func(xmlNodePtr node
)
22 Options
*o
= g_slice_new0(Options
);
25 if ((n
= obt_xml_find_node(node
, "strict")))
26 o
->strict
= obt_xml_node_bool(n
);
31 static void free_func(gpointer o
)
33 g_slice_free(Options
, o
);
36 /* Always return FALSE because its not interactive */
37 static gboolean
run_func(ObActionsData
*data
, gpointer options
)
41 ObScreenShowDestopMode show_mode
;
42 if (screen_showing_desktop())
43 show_mode
= SCREEN_SHOW_DESKTOP_NO
;
45 show_mode
= SCREEN_SHOW_DESKTOP_UNTIL_WINDOW
;
47 show_mode
= SCREEN_SHOW_DESKTOP_UNTIL_TOGGLE
;
49 screen_show_desktop(show_mode
, NULL
);