add maximize action
Dana Jansens danakj@orodu.net
5 files changed,
29 insertions(+),
39 deletions(-)
M
Makefile.am
→
Makefile.am
@@ -166,6 +166,7 @@ openbox/actions/focus.c \
openbox/actions/fullscreen.c \ openbox/actions/iconify.c \ openbox/actions/lower.c \ + openbox/actions/maximize.c \ openbox/actions/move.c \ openbox/actions/raise.c \ openbox/actions/raiselower.c \
M
openbox/action.c
→
openbox/action.c
@@ -525,21 +525,6 @@ action_resize_relative,
setup_client_action }, { - "maximizefull", - action_maximize_full, - setup_client_action - }, - { - "unmaximizefull", - action_unmaximize_full, - setup_client_action - }, - { - "togglemaximizefull", - action_toggle_maximize_full, - setup_client_action - }, - { "maximizehorz", action_maximize_horz, setup_client_action@@ -1140,30 +1125,6 @@ xoff = xoff == 0 ? 0 : (xoff < 0 ? MAX(xoff, ow-nw) : MIN(xoff, ow-nw));
yoff = yoff == 0 ? 0 : (yoff < 0 ? MAX(yoff, oh-nh) : MIN(yoff, oh-nh)); client_move_resize(c, x + xoff, y + yoff, nw, nh); client_action_end(data, FALSE); -} - -void action_maximize_full(union ActionData *data) -{ - client_action_start(data); - client_maximize(data->client.any.c, TRUE, 0); - client_action_end(data, config_focus_under_mouse); -} - -void action_unmaximize_full(union ActionData *data) -{ - client_action_start(data); - client_maximize(data->client.any.c, FALSE, 0); - client_action_end(data, config_focus_under_mouse); -} - -void action_toggle_maximize_full(union ActionData *data) -{ - client_action_start(data); - client_maximize(data->client.any.c, - !(data->client.any.c->max_horz || - data->client.any.c->max_vert), - 0); - client_action_end(data, config_focus_under_mouse); } void action_maximize_horz(union ActionData *data)
M
openbox/actions/all.c
→
openbox/actions/all.c
@@ -20,4 +20,5 @@ action_raiselower_startup();
action_unfocus_startup(); action_iconify_startup(); action_fullscreen_startup(); + action_maximize_startup(); }
M
openbox/actions/all.h
→
openbox/actions/all.h
@@ -21,5 +21,6 @@ void action_raiselower_startup();
void action_unfocus_startup(); void action_iconify_startup(); void action_fullscreen_startup(); +void action_maximize_startup(); #endif
A
openbox/actions/maximize.c
@@ -0,0 +1,26 @@
+#include "openbox/actions.h" +#include "openbox/client.h" + +static gboolean run_func(ObActionsData *data, gpointer options); + +void action_maximize_startup() +{ + actions_register("Maximize", + NULL, NULL, + run_func, + NULL, NULL); +} + +/* Always return FALSE because its not interactive */ +static gboolean run_func(ObActionsData *data, gpointer options) +{ + if (data->client) { + actions_client_move(data, TRUE); + client_maximize(data->client, + !(data->client->max_horz || data->client->max_vert), + 0); + actions_client_move(data, FALSE); + } + + return FALSE; +}