2 Jun 2012 05:04
dwm window outline during mouse resize/move patch
John A. Grahor <jag <at> techma.com>
2012-06-02 03:04:29 GMT
2012-06-02 03:04:29 GMT
I forward X halfway around the world and the mouse move/resize as implemented in dwm brings things to a screeching halt. I noticed that the non-solid move/resize in evilwm works much better because it doesn't demand the client to redraw a billion times as you drag the mouse because it just draws a wire frame of the window as you drag. I have included a patch for dwm-5.8.2 in which I basically stole the wire frame move/resize code from evilwm and adapted it for dwm. If anyone is interested I'll do a patch for a more modern release.
diff -up dwm-5.8.2/dwm.c dwm-5.8.2-wired/dwm.c
--- dwm-5.8.2/dwm.c 2010-06-04 06:39:15.000000000 -0400
+++ dwm-5.8.2-wired/dwm.c 2012-06-01 22:58:02.000000000 -0400
<at> <at> -101,6 +101,7 <at> <at> typedef struct {
unsigned long sel[ColLast];
Drawable drawable;
GC gc;
+ GC invert_gc;
struct {
int ascent;
int descent;
<at> <at> -177,6 +178,7 <at> <at> static void drawbar(Monitor *m);
static void drawbars(void);
static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+static void draw_outline(int x, int y, int w, int h, int bw);
static void enternotify(XEvent *e);
(Continue reading)
RSS Feed