# HG changeset patch # User Thomas Dahms # Date 1288773625 -3600 # Node ID b86e37eb3d5f0f348239b8abf72d8caf9f4b617b # Parent 406003e3a01f8584f7bb54d0e5b1ff6585f7de6d Virtualbox workaround. diff -r 406003e3a01f -r b86e37eb3d5f dwm.c --- a/dwm.c Mon Sep 27 07:53:44 2010 +0000 +++ b/dwm.c Wed Nov 03 09:40:25 2010 +0100 @@ -202,6 +202,7 @@ static Monitor *ptrtomon(int x, int y); static void propertynotify(XEvent *e); static void quit(const Arg *arg); +static void redrawborder(Client *c); static void resize(Client *c, int x, int y, int w, int h, Bool interact); static void resizeclient(Client *c, int x, int y, int w, int h); static void resizemouse(const Arg *arg); @@ -825,6 +826,7 @@ attachstack(c); grabbuttons(c, True); XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); + redrawborder(c); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); } else @@ -1334,6 +1336,16 @@ } void +redrawborder(Client *c) { + /* works around a bug in X drivers of Virtualbox and VMWare */ + XWindowChanges wc; + wc.border_width = 0; + XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); + wc.border_width = c->bw; + XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); +} + +void resizeclient(Client *c, int x, int y, int w, int h) { XWindowChanges wc; @@ -1704,6 +1716,7 @@ return; grabbuttons(c, False); XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); + redrawborder(c); if(setfocus) XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); }