From 9d136ab7983ac5bc6f640199032f6b76e8328e82 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 29 Mar 2003 00:58:50 +0000 Subject: [PATCH] add unshaderaise and shadelower actions from Mikachu --- openbox/action.c | 24 ++++++++++++++++++++++++ openbox/action.h | 4 ++++ plugins/keyboard/keysrc | 4 ++++ plugins/mouse/mouserc | 4 ++++ 4 files changed, 36 insertions(+) diff --git a/openbox/action.c b/openbox/action.c index ccb988d9..521e3135 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -52,6 +52,10 @@ Action *action_from_string(char *name) a = action_new(action_close); } else if (!g_ascii_strcasecmp(name, "kill")) { a = action_new(action_kill); + } else if (!g_ascii_strcasecmp(name, "shadelower")) { + a = action_new(action_shadelower); + } else if (!g_ascii_strcasecmp(name, "unshaderaise")) { + a = action_new(action_unshaderaise); } else if (!g_ascii_strcasecmp(name, "shade")) { a = action_new(action_shade); } else if (!g_ascii_strcasecmp(name, "unshade")) { @@ -196,6 +200,26 @@ void action_raise(union ActionData *data) stacking_raise(data->client.c); } +void action_unshaderaise(union ActionData *data) +{ + if (data->client.c) { + if (data->client.c->shaded) + client_shade(data->client.c, FALSE); + else + stacking_raise(data->client.c); + } +} + +void action_shadelower(union ActionData *data) +{ + if (data->client.c) { + if (data->client.c->shaded) + stacking_lower(data->client.c); + else + client_shade(data->client.c, TRUE); + } +} + void action_lower(union ActionData *data) { if (data->client.c) diff --git a/openbox/action.h b/openbox/action.h index 95d9bc2c..fae5b647 100644 --- a/openbox/action.h +++ b/openbox/action.h @@ -120,6 +120,10 @@ void action_kill(union ActionData *data); /* ClientAction */ void action_shade(union ActionData *data); /* ClientAction */ +void action_shadelower(union ActionData *data); +/* ClientAction */ +void action_unshaderaise(union ActionData *data); +/* ClientAction */ void action_unshade(union ActionData *data); /* ClientAction */ void action_toggle_shade(union ActionData *data); diff --git a/plugins/keyboard/keysrc b/plugins/keyboard/keysrc index d31235c6..daa07f53 100644 --- a/plugins/keyboard/keysrc +++ b/plugins/keyboard/keysrc @@ -24,6 +24,10 @@ # * Shade - Shade (roll up) the focused client # * Unshade - Unshade (roll down) the focused client # * ToggleShade - Shade and unshade the focused client +# * ShadeLower - Shades the window if it's not shaded, and lower it +# if it was already shaded +# * UnshadeRaise - Unshades the window if it's shaded, and raise it +# if it was already unshaded # * ToggleOmnipresent - Place the focused client on all desktops or the # current one # * MaximizeFull - Maximize the focused window horizontally and vertically diff --git a/plugins/mouse/mouserc b/plugins/mouse/mouserc index 573d629e..739ac30e 100644 --- a/plugins/mouse/mouserc +++ b/plugins/mouse/mouserc @@ -54,6 +54,10 @@ # * Shade - Shade (roll up) the client # * Unshade - Unshade (roll down) the client # * ToggleShade - Shade and unshade the client +# * ShadeLower - Shades the window if it's not shaded, and lower it +# if it was already shaded +# * UnshadeRaise - Unshades the window if it's shaded, and raise it +# if it was already unshaded # * ToggleOmnipresent - Place the client on all desktops or the current one # * MaximizeFull - Maximize the window horizontally and vertically # * UnmaximizeFull - Restore the window horizontally and vertically -- 2.39.2