[hackers] [wmii] Unmap client on opaque moves. Will this improve resource usage?

From: Kris Maglione <jg_AT_suckless.org>
Date: Sun Feb 11 20:46:18 2007

changeset: 1847:3eecfbd54dc2
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Feb 11 14:45:14 2007 -0500
summary: Unmap client on opaque moves. Will this improve resource usage?

diff -r 62a1233d88b6 -r 3eecfbd54dc2 client.c
--- a/client.c Sun Feb 11 13:32:15 2007 -0500
+++ b/client.c Sun Feb 11 14:45:14 2007 -0500
@@ -51,7 +51,7 @@ create_client(Window w, XWindowAttribute
                         c->rect.height + def.border + labelh(&def.font), 0,
                         DefaultDepth(blz.dpy, blz.screen), CopyFromParent,
                         DefaultVisual(blz.dpy, blz.screen),
- CWOverrideRedirect | CWBackPixmap | CWEventMask, &fwa);
+ CWOverrideRedirect | CWEventMask, &fwa);
         c->gc = XCreateGC(blz.dpy, c->framewin, 0, 0);
         XSync(blz.dpy, False);
         for(t=&client; *t; t=&(*t)->next);
diff -r 62a1233d88b6 -r 3eecfbd54dc2 mouse.c
--- a/mouse.c Sun Feb 11 13:32:15 2007 -0500
+++ b/mouse.c Sun Feb 11 14:45:14 2007 -0500
@@ -375,7 +375,9 @@ do_mouse_resize(Client *c, Bool grabbox,
         if(!grabbox) {
                 XGrabServer(blz.dpy);
                 draw_xor_border(&frect);
- }
+ }else
+ unmap_client(c, IconicState);
+
         for(;;) {
                 XMaskEvent(blz.dpy, MouseMask | ExposureMask, &ev);
                 switch (ev.type) {
@@ -397,7 +399,8 @@ do_mouse_resize(Client *c, Bool grabbox,
                                         pt_y = screen->brect.y - 1;
                                 XWarpPointer(blz.dpy, None, blz.root, 0, 0, 0, 0, pt_x, pt_y);
                                 XUngrabServer(blz.dpy);
- }
+ }else
+ map_client(c);
 
                         if(rects)
                                 free(rects);
@@ -435,7 +438,7 @@ do_mouse_resize(Client *c, Bool grabbox,
                         match_sizehints(c, &frect, floating, grav);
 
                         if(grabbox) {
- resize_client(c, &frect);
+ XMoveWindow(blz.dpy, c->framewin, frect.x, frect.y);
                                 XSync(blz.dpy, False);
                         } else {
                                 draw_xor_border(&ofrect);
Received on Sun Feb 11 2007 - 20:46:18 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:11 UTC