From d6d360bae681df1bf93830a834fca9fafa332458 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 19 Jul 2007 16:00:59 -0400 Subject: [PATCH] add shadelower and unshaderaise actions back --- Makefile.am | 1 + openbox/actions/all.c | 1 + openbox/actions/all.h | 1 + openbox/actions/shadelowerraise.c | 39 +++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 openbox/actions/shadelowerraise.c diff --git a/Makefile.am b/Makefile.am index ba09d2e6..b6db6799 100644 --- a/Makefile.am +++ b/Makefile.am @@ -182,6 +182,7 @@ openbox_openbox_SOURCES = \ openbox/actions/resizerelative.c \ openbox/actions/restart.c \ openbox/actions/shade.c \ + openbox/actions/shadelowerraise.c \ openbox/actions/showdesktop.c \ openbox/actions/showmenu.c \ openbox/actions/unfocus.c \ diff --git a/openbox/actions/all.c b/openbox/actions/all.c index 4b21e7e6..de00d4ab 100644 --- a/openbox/actions/all.c +++ b/openbox/actions/all.c @@ -37,4 +37,5 @@ void action_all_startup() action_movetoedge_startup(); action_growtoedge_startup(); action_focustobottom_startup(); + action_shadelowerraise_startup(); } diff --git a/openbox/actions/all.h b/openbox/actions/all.h index 72324bb2..08fb8f47 100644 --- a/openbox/actions/all.h +++ b/openbox/actions/all.h @@ -38,5 +38,6 @@ void action_layer_startup(); void action_movetoedge_startup(); void action_growtoedge_startup(); void action_focustobottom_startup(); +void action_shadelowerraise_startup(); #endif diff --git a/openbox/actions/shadelowerraise.c b/openbox/actions/shadelowerraise.c new file mode 100644 index 00000000..e9ba12d5 --- /dev/null +++ b/openbox/actions/shadelowerraise.c @@ -0,0 +1,39 @@ +#include "openbox/actions.h" +#include "openbox/client.h" + +static gboolean run_func_sl(ObActionsData *data, gpointer options); +static gboolean run_func_ur(ObActionsData *data, gpointer options); + +void action_shadelowerraise_startup() +{ + actions_register("ShadeLower", NULL, NULL, run_func_sl, NULL, NULL); + actions_register("UnshadeRaise", NULL, NULL, run_func_ur, NULL, NULL); +} + +/* Always return FALSE because its not interactive */ +static gboolean run_func_sl(ObActionsData *data, gpointer options) +{ + if (data->client) { + actions_client_move(data, TRUE); + if (data->client->shaded) + stacking_lower(CLIENT_AS_WINDOW(data->client)); + else + client_shade(data->client, TRUE); + actions_client_move(data, FALSE); + } + return FALSE; +} + +/* Always return FALSE because its not interactive */ +static gboolean run_func_ur(ObActionsData *data, gpointer options) +{ + if (data->client) { + actions_client_move(data, TRUE); + if (data->client->shaded) + client_shade(data->client, FALSE); + else + stacking_raise(CLIENT_AS_WINDOW(data->client)); + actions_client_move(data, FALSE); + } + return FALSE; +} -- 2.34.1