From bc38a1ab32404a179c88e79663bfa14f51cce2ac Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Wed, 24 Feb 2021 15:50:29 -0500 Subject: [PATCH] config.h, key.c: add gaps for psuedotiling --- config.h | 2 ++ key.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config.h b/config.h index 46786ee..681e8b5 100755 --- a/config.h +++ b/config.h @@ -5,6 +5,8 @@ #define GHOSTCOL 0x797979 #define BORDER 4 +#define GAPSZ 4 + #define MENUBORDER 0 #define MBORDERCOL 0x000000 #define MENUFGCOL 0x797979 diff --git a/key.c b/key.c index cad863f..ba7805a 100755 --- a/key.c +++ b/key.c @@ -147,23 +147,23 @@ keypress(XKeyEvent *e) /* half snap */ if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width/2, ra.height); + quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height - 2*GAPSZ); if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/2, 0, ra.width/2, ra.height); + quickreshape(current, ra.width/2 + GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height - 2*GAPSZ); if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, ra.height/2, ra.width, ra.height/2); + quickreshape(current, GAPSZ, ra.height/2 + GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 2*GAPSZ); if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width, ra.height/2); + quickreshape(current, GAPSZ, GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 2*GAPSZ); /* quarter snap */ if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, 0, ra.width/2, ra.height/2); + quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ); if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, 0, ra.height/2, ra.width/2, ra.height/2); + quickreshape(current, GAPSZ, ra.height/2 + GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ); if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/2, ra.height/2, ra.width/2, ra.height/2); + quickreshape(current, ra.width/2 + GAPSZ, ra.height/2 + GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ); if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS)) - quickreshape(current, ra.width/2, 0, ra.width/2, ra.height/2); + quickreshape(current, ra.width/2 + GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ); /* center snap */ if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS))