aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authoroga2008-04-15 18:46:58 +0000
committeroga2008-04-15 18:46:58 +0000
commit137723ad08c9062a346b29d72b4b2ce55971c217 (patch)
tree3474a796c67fec132d69b1897a5c6dc41fbec4d3 /client.c
parent00cd3801d9c4a25c527a378add86c705efa671d6 (diff)
downloadcwm-137723ad08c9062a346b29d72b4b2ce55971c217.tar.gz
Add "gap" support to .cwmrc. The options put in here make gaps on the edge
of the screen where an application won't be {,vert}maximized over. used for placing a statusbar or something like xclock. Patch from Edd Barrett, with input from myself and okan. Thanks! ok okan@.
Diffstat (limited to 'client.c')
-rw-r--r--client.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/client.c b/client.c
index 264d025..678e6b7 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: client.c,v 1.15 2008/04/09 18:10:47 okan Exp $
+ * $Id: client.c,v 1.16 2008/04/15 18:46:58 oga Exp $
*/
#include "headers.h"
@@ -339,10 +339,12 @@ client_maximize(struct client_ctx *cc)
XGetWindowAttributes(X_Dpy, sc->rootwin, &rootwin_geom);
if (!(cc->flags & CLIENT_VMAXIMIZED))
cc->savegeom = cc->geom;
- cc->geom.x = 0;
- cc->geom.y = 0;
- cc->geom.height = rootwin_geom.height;
- cc->geom.width = rootwin_geom.width;
+ cc->geom.x = Conf.gap_left;
+ cc->geom.y = Conf.gap_top;
+ cc->geom.height = rootwin_geom.height -
+ (Conf.gap_top + Conf.gap_bottom);
+ cc->geom.width = rootwin_geom.width -
+ (Conf.gap_left + Conf.gap_right);
cc->flags |= CLIENT_DOMAXIMIZE;
}
@@ -765,12 +767,9 @@ client_vertmaximize(struct client_ctx *cc)
if (!(cc->flags & CLIENT_MAXIMIZED))
cc->savegeom = cc->geom;
- cc->geom.y = cc->bwidth;
- if (cc->geom.min_dx == 0)
- cc->geom.height = display_height;
- else
- cc->geom.height = display_height -
- (display_height % cc->geom.min_dx);
+ cc->geom.y = cc->bwidth + Conf.gap_top;
+ cc->geom.height = display_height -
+ (Conf.gap_top + Conf.gap_bottom);
cc->flags |= CLIENT_DOVMAXIMIZE;
}