From 4d814a383b099c48ad9b61cb94d25ef16b1a698a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 22 May 2003 02:22:43 +0000 Subject: add actions for changing client layers to abov/below/normal --- openbox/action.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'openbox/action.c') diff --git a/openbox/action.c b/openbox/action.c index ad12c331..b514916f 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -170,6 +170,21 @@ void setup_action_movetoedge_west(Action *a) a->data.diraction.direction = Direction_West; } +void setup_action_top_layer(Action *a) +{ + a->data.layer.layer = 1; +} + +void setup_action_normal_layer(Action *a) +{ + a->data.layer.layer = 0; +} + +void setup_action_bottom_layer(Action *a) +{ + a->data.layer.layer = -1; +} + ActionString actionstrings[] = { { @@ -482,6 +497,31 @@ ActionString actionstrings[] = action_showmenu, NULL }, + { + "sendtotoplayer", + action_send_to_layer, + setup_action_top_layer + }, + { + "togglealwaysontop", + action_toggle_layer, + setup_action_top_layer + }, + { + "sendtonormallayer", + action_send_to_layer, + setup_action_normal_layer + }, + { + "sendtobottomlayer", + action_send_to_layer, + setup_action_bottom_layer + }, + { + "togglealwaysonbottom", + action_toggle_layer, + setup_action_bottom_layer + }, { "nextwindowlinear", action_cycle_windows, @@ -1087,3 +1127,21 @@ void action_movetoedge(union ActionData *data) x, y, c->area.width, c->area.height, TRUE, TRUE); } + +void action_send_to_layer(union ActionData *data) +{ + if (data->layer.c) + client_set_layer(data->layer.c, data->layer.layer); +} + +void action_toggle_layer(union ActionData *data) +{ + Client *c = data->layer.c; + + if (c) { + if (data->layer.layer < 0) + client_set_layer(c, c->below ? 0 : -1); + else if (data->layer.layer > 0) + client_set_layer(c, c->above ? 0 : 1); + } +} -- cgit v1.2.3