X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=event.c;h=db0d4826b129714978666013e09b688787d8cf22;hb=ecd9c3e22289b1627f7239e393bfb9c1967eee32;hp=72e9ccd0124a9bf4aafb146c43f34d6a2421a178;hpb=464fc2cd18e82e6b1c169a5a7ce19f923d08d4e3;p=dwm.git diff --git a/event.c b/event.c index 72e9ccd..db0d482 100644 --- a/event.c +++ b/event.c @@ -208,6 +208,22 @@ configurerequest(XEvent *e) { } static void +configurenotify(XEvent *e) { + XConfigureEvent *ev = &e->xconfigure; + + if (ev->window == root && (ev->width != sw || ev->height != sh)) { + sw = ev->width; + sh = ev->height; + wah = sh - bh; + waw = sw; + XFreePixmap(dpy, dc.drawable); + dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); + XResizeWindow(dpy, barwin, sw, bh); + lt->arrange(); + } +} + +static void destroynotify(XEvent *e) { Client *c; XDestroyWindowEvent *ev = &e->xdestroywindow; @@ -333,6 +349,7 @@ unmapnotify(XEvent *e) { void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, [ConfigureRequest] = configurerequest, + [ConfigureNotify] = configurenotify, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify, [LeaveNotify] = leavenotify,