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/client.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'openbox/client.h') diff --git a/openbox/client.h b/openbox/client.h index 5ae2d3d2..a753b123 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -489,9 +489,21 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, gint *dest, gboolean *near_edge); void client_find_move_directional(ObClient *self, ObDirection dir, gint *x, gint *y); -void client_find_resize_directional(ObClient *self, ObDirection side, - gboolean grow, - gint *x, gint *y, gint *w, gint *h); + +typedef enum { + CLIENT_RESIZE_GROW, + CLIENT_RESIZE_GROW_IF_NOT_ON_EDGE, + CLIENT_RESIZE_SHRINK, +} ObClientDirectionalResizeType; + +/*! Moves the client area passed in to grow/shrink the given edge. + @return TRUE if any change was made to the client area. +*/ +gboolean client_find_resize_directional( + ObClient *self, + ObDirection side, + ObClientDirectionalResizeType resize_type, + gint *x, gint *y, gint *w, gint *h); /*! Fullscreen's or unfullscreen's the client window @param fs true if the window should be made fullscreen; false if it should -- cgit v1.2.3