From 1a32ba561afef1a3dabeb8d4443c1aafe7ad9977 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 26 Mar 2003 13:13:45 +0000 Subject: [PATCH] split up the relative move/resize actions into horz/vert --- openbox/action.c | 41 +++++++++++++++++++++++++++++++---------- openbox/action.h | 11 +++++++---- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/openbox/action.c b/openbox/action.c index 4cd75107..ce96ad41 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -60,10 +60,14 @@ Action *action_from_string(char *name) a = action_new(action_toggle_shade); } else if (!g_ascii_strcasecmp(name, "toggleomnipresent")) { a = action_new(action_toggle_omnipresent); - } else if (!g_ascii_strcasecmp(name, "moverelative")) { - a = action_new(action_move_relative); - } else if (!g_ascii_strcasecmp(name, "resizerelative")) { - a = action_new(action_resize_relative); + } else if (!g_ascii_strcasecmp(name, "moverelativehorz")) { + a = action_new(action_move_relative_horz); + } else if (!g_ascii_strcasecmp(name, "moverelativevert")) { + a = action_new(action_move_relative_vert); + } else if (!g_ascii_strcasecmp(name, "resizerelativehorz")) { + a = action_new(action_resize_relative_horz); + } else if (!g_ascii_strcasecmp(name, "resizerelativevert")) { + a = action_new(action_resize_relative_vert); } else if (!g_ascii_strcasecmp(name, "maximizefull")) { a = action_new(action_maximize_full); } else if (!g_ascii_strcasecmp(name, "unmaximizefull")) { @@ -234,23 +238,40 @@ void action_toggle_omnipresent(union ActionData *data) screen_desktop : DESKTOP_ALL); } -void action_move_relative(union ActionData *data) +void action_move_relative_horz(union ActionData *data) { Client *c = data->relative.c; if (c) client_configure(c, Corner_TopLeft, - c->area.x + data->relative.dx, - c->area.y + data->relative.dy, + c->area.x + data->relative.delta, c->area.y, c->area.width, c->area.height, TRUE, TRUE); } -void action_resize_relative(union ActionData *data) +void action_move_relative_vert(union ActionData *data) +{ + Client *c = data->relative.c; + if (c) + client_configure(c, Corner_TopLeft, + c->area.x, c->area.y + data->relative.delta, + c->area.width, c->area.height, TRUE, TRUE); +} + +void action_resize_relative_horz(union ActionData *data) +{ + Client *c = data->relative.c; + if (c) + client_configure(c, Corner_TopLeft, c->area.x, c->area.y, + c->area.width + data->relative.delta, + c->area.height, TRUE, TRUE); +} + +void action_resize_relative_vert(union ActionData *data) { Client *c = data->relative.c; if (c) client_configure(c, Corner_TopLeft, c->area.x, c->area.y, - c->area.width + data->relative.dx, - c->area.height + data->relative.dy, TRUE, TRUE); + c->area.width, c->area.height + data->relative.delta, + TRUE, TRUE); } void action_maximize_full(union ActionData *data) diff --git a/openbox/action.h b/openbox/action.h index e3d891f0..672ee6c4 100644 --- a/openbox/action.h +++ b/openbox/action.h @@ -23,8 +23,7 @@ struct ClientAction { struct MoveResizeRelative { Client *c; - int dx; - int dy; + int delta; }; struct SendToDesktop { @@ -123,9 +122,13 @@ void action_toggle_shade(union ActionData *data); /* ClientAction */ void action_toggle_omnipresent(union ActionData *data); /* MoveResizeRelative */ -void action_move_relative(union ActionData *data); +void action_move_relative_horz(union ActionData *data); /* MoveResizeRelative */ -void action_resize_relative(union ActionData *data); +void action_move_relative_vert(union ActionData *data); +/* MoveResizeRelative */ +void action_resize_relative_horz(union ActionData *data); +/* MoveResizeRelative */ +void action_resize_relative_vert(union ActionData *data); /* ClientAction */ void action_maximize_full(union ActionData *data); /* ClientAction */ -- 2.45.2