config.h: document GAPSZ should be even; key.c: only use new center ratio; event.c: spawn new terminals with new ratio via kb
This commit is contained in:
parent
bc38a1ab32
commit
3a2f736ce5
3 changed files with 28 additions and 27 deletions
1
config.h
1
config.h
|
@ -5,6 +5,7 @@
|
|||
#define GHOSTCOL 0x797979
|
||||
#define BORDER 4
|
||||
|
||||
/* Should be even */
|
||||
#define GAPSZ 4
|
||||
|
||||
#define MENUBORDER 0
|
||||
|
|
2
event.c
2
event.c
|
@ -292,7 +292,7 @@ newwindow(XCreateWindowEvent *e)
|
|||
if (kbLaunch)
|
||||
{
|
||||
usleep(100000);
|
||||
quickreshape(c, ra.width/5, ra.height/5, 3*ra.width/5, 3*ra.height/5);
|
||||
quickreshape(c, ra.width/6, GAPSZ, 2*ra.width/3, ra.height - 2*GAPSZ);
|
||||
kbLaunch = 0;
|
||||
}
|
||||
}
|
||||
|
|
50
key.c
50
key.c
|
@ -130,44 +130,44 @@ keypress(XKeyEvent *e)
|
|||
/* basic wm functionality */
|
||||
if(e->keycode == tabcode && (e->state&Mod1Mask) == (1<<3))
|
||||
alttab(e->state&ShiftMask);
|
||||
if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
delete(current, 0);
|
||||
if (e->keycode == icode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if (e->keycode == icode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
hide(current);
|
||||
if (e->keycode == ucode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if (e->keycode == ucode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
unhide(0, 1);
|
||||
if (e->keycode == vcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if (e->keycode == vcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
move(current, Button3);
|
||||
if (e->keycode == rcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if (e->keycode == rcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
reshape(current, Button3, sweep, 0);
|
||||
if (e->keycode == mcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if (e->keycode == mcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, -BORDER, -BORDER, ra.width + 2*BORDER, ra.height + 2*BORDER);
|
||||
if (e->keycode == scode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
else if (e->keycode == scode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
stick(current);
|
||||
|
||||
/* half snap */
|
||||
if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
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 + GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height - 2*GAPSZ);
|
||||
if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
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, GAPSZ, GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
|
||||
else if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 1.5*GAPSZ, ra.height - 2*GAPSZ);
|
||||
else if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, ra.width/2 + 0.5*GAPSZ, GAPSZ, ra.width/2 - 1.5*GAPSZ, ra.height - 2*GAPSZ);
|
||||
else if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, GAPSZ, ra.height/2 + 0.5*GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 1.5*GAPSZ);
|
||||
else if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, GAPSZ, GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 1.5*GAPSZ);
|
||||
|
||||
/* quarter snap */
|
||||
if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
|
||||
if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
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 + 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 + GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
|
||||
else if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 1.5*GAPSZ, ra.height/2 - 1.5*GAPSZ);
|
||||
else if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, GAPSZ, ra.height/2 + 0.5*GAPSZ, ra.width/2 - 1.5*GAPSZ, ra.height/2 - 1.5*GAPSZ);
|
||||
else if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, ra.width/2 + 0.5*GAPSZ, ra.height/2 + 0.5*GAPSZ, ra.width/2 - 1.5*GAPSZ, ra.height/2 - 1.5*GAPSZ);
|
||||
else if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, ra.width/2 + 0.5*GAPSZ, GAPSZ, ra.width/2 - 1.5*GAPSZ, ra.height/2 - 1.5*GAPSZ);
|
||||
|
||||
/* center snap */
|
||||
if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, ra.width/5, ra.height/5, 3*ra.width/5, 3*ra.height/5);
|
||||
else if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(current, ra.width/6, GAPSZ, 2*ra.width/3, ra.height - 2*GAPSZ);
|
||||
|
||||
#ifdef DEVEL
|
||||
/* manage autostuck windows */
|
||||
|
|
Loading…
Reference in a new issue