From f5e9df18a46240b4fdaebf540a1052e65507dcfe Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 1 Sep 2013 16:48:39 -0400 Subject: Clean up the FillToEdge action implementation This extend the client_find_resize_directional() method to support two growing modes, and return a bool for whether it was able to grow/shrink. The client_find_resize_directional() method now takes an enum instead of a bool, with two growing modes. The old mode which always tries to grow, the a new mode that will only grow if the client's edge is not already at a grow stopping point (ie against the edge of another window). --- openbox/moveresize.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'openbox/moveresize.c') diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 333a1bea..d12a64de 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -795,8 +795,13 @@ static void resize_with_keys(KeySym sym, guint state) else /* if (sym == XK_Up)) */ dir = OB_DIRECTION_NORTH; - client_find_resize_directional(moveresize_client, key_resize_edge, - key_resize_edge == dir, + ObClientDirectionalResizeType resize_type = + key_resize_edge == dir ? CLIENT_RESIZE_GROW + : CLIENT_RESIZE_SHRINK; + + client_find_resize_directional(moveresize_client, + key_resize_edge, + resize_type, &x, &y, &w, &h); dw = w - moveresize_client->area.width; dh = h - moveresize_client->area.height; -- cgit v1.2.3