1. Thomas Dahms
  2. dwm-patches

Commits

Thomas Dahms  committed 4c131d7

Workaround for Virtualbox border redrawing issue

  • Participants
  • Parent commits 6be6a85
  • Branches default

Comments (0)

Files changed (2)

File series

View file
 ncol
 configdefdefault
 config
+virtualbox

File virtualbox

View file
+# HG changeset patch
+# Parent 2a1db2fe5c6a6a6f10fd0c1cd622d99b0e1bd622
+
+diff -r 2a1db2fe5c6a dwm.c
+--- a/dwm.c	Wed Dec 14 00:52:54 2011 +0100
++++ b/dwm.c	Wed Dec 14 13:13:21 2011 +0100
+@@ -208,6 +208,7 @@
+ static void propertynotify(XEvent *e);
+ static void quit(const Arg *arg);
+ static Monitor *recttomon(int x, int y, int w, int h);
++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);
+@@ -857,6 +858,7 @@
+ 		attachstack(c);
+ 		grabbuttons(c, True);
+ 		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
++		redrawborder(c);
+ 		setfocus(c);
+ 	}
+ 	else
+@@ -1371,6 +1373,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;
+ 
+@@ -1800,6 +1812,7 @@
+ 		return;
+ 	grabbuttons(c, False);
+ 	XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
++	redrawborder(c);
+ 	if(setfocus)
+ 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ }