add guard against mangling root window in quickreshape()

This commit is contained in:
Iris Lightshard 2020-02-29 10:38:12 -05:00
parent ae6903668b
commit 467f53aa0b
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

4
key.c
View file

@ -115,7 +115,7 @@ keypress(XKeyEvent *e)
alttab(e->state&ShiftMask); alttab(e->state&ShiftMask);
if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS)) if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS))
delete(current, 0); delete(current, 0);
if(e->keycode == icode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == icode && (e->state&SHORTCUTMOD) == (MODBITS))
hide(current); hide(current);
if (e->keycode == vcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == vcode && (e->state&SHORTCUTMOD) == (MODBITS))
move(current, Button3); move(current, Button3);
@ -191,6 +191,8 @@ keyrelease(XKeyEvent *e)
void void
quickreshape(Client *c, int x, int y, int dx, int dy) quickreshape(Client *c, int x, int y, int dx, int dy)
{ {
if (c == 0)
return;
XMoveResizeWindow(dpy, c->parent, x,y, dx, dy); XMoveResizeWindow(dpy, c->parent, x,y, dx, dy);
c->x = x + BORDER; c->x = x + BORDER;
c->y = y + BORDER; c->y = y + BORDER;