From 467f53aa0b22ed3221ba5464ad33d3ad3bb3f984 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Sat, 29 Feb 2020 10:38:12 -0500 Subject: [PATCH] add guard against mangling root window in quickreshape() --- key.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/key.c b/key.c index 2c5e7ad..8bdc6ee 100755 --- a/key.c +++ b/key.c @@ -115,7 +115,7 @@ keypress(XKeyEvent *e) alttab(e->state&ShiftMask); if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS)) delete(current, 0); - if(e->keycode == icode && (e->state&SHORTCUTMOD) == (MODBITS)) + if (e->keycode == icode && (e->state&SHORTCUTMOD) == (MODBITS)) hide(current); if (e->keycode == vcode && (e->state&SHORTCUTMOD) == (MODBITS)) move(current, Button3); @@ -191,6 +191,8 @@ keyrelease(XKeyEvent *e) void quickreshape(Client *c, int x, int y, int dx, int dy) { + if (c == 0) + return; XMoveResizeWindow(dpy, c->parent, x,y, dx, dy); c->x = x + BORDER; c->y = y + BORDER;