X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/338c0838580b32f1258a800392d93cf973baf1e6..216099d072e98a830ac8689077faad469388fdad:/event.c?ds=sidebyside diff --git a/event.c b/event.c index 6386659..db0d482 100644 --- a/event.c +++ b/event.c @@ -1,6 +1,6 @@ -/* (C)opyright MMVI-MMVII Anselm R. Garbe - * See LICENSE file for license details. - */ +/* © 2006-2007 Anselm R. Garbe + * © 2006-2007 Sander van Dijk + * See LICENSE file for license details. */ #include "dwm.h" #include #include @@ -207,6 +207,22 @@ configurerequest(XEvent *e) { XSync(dpy, False); } +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; @@ -333,6 +349,7 @@ unmapnotify(XEvent *e) { void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, [ConfigureRequest] = configurerequest, + [ConfigureNotify] = configurenotify, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify, [LeaveNotify] = leavenotify,