]> git.mdlowis.com Git - proto/anvil.git/commitdiff
improved performance of move and resize by syncing on resize and discarding all but...
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 11 Mar 2020 20:48:45 +0000 (16:48 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 11 Mar 2020 20:48:45 +0000 (16:48 -0400)
anvil.c
client.c

diff --git a/anvil.c b/anvil.c
index e74254bc6ed3b44f26831b08083cf80786fc51d6..5a7000d21301c92bc3175897c0453d3a0168d7c4 100644 (file)
--- a/anvil.c
+++ b/anvil.c
@@ -53,6 +53,11 @@ static inline int PRESSED(int mods, int btn)
 static void xbtnmotion(XEvent* e)
 {
     XMotionEvent *ev = &e->xmotion;
+    while (XCheckTypedWindowEvent(X.disp, ev->window, ev->type, e))
+    {
+        /* Keep grabbing them till we have no more to grab */
+    }
+
     Client* c = client_get(ev->window);
     if (c && (ev->window == c->frame))
     {
@@ -85,6 +90,13 @@ static void xconfigrequest(XEvent* e)
     wc.sibling = ev->above;
     wc.stack_mode = ev->detail;
     XConfigureWindow(X.disp, ev->window, ev->value_mask, &wc);
+    Client* c = client_get(ev->window);
+    if (c && c->win == ev->window)
+    {
+        c->w = wc.width;
+        c->h = wc.height;
+        client_resize(c, 0, 0);
+    }
 }
 
 static void xmaprequest(XEvent* e)
index 88a3afedbd85b3943c55d9e9d6bcbf64232a02c0..5fcd42bf5fd5dafdcf02e22624ca1c4138c2a98f 100644 (file)
--- a/client.c
+++ b/client.c
@@ -129,6 +129,7 @@ void client_resize(Client* c, int xdiff, int ydiff)
     XResizeWindow(X.disp, c->frame,
         c->w + 2*BORDER_WIDTH,
         c->h + 2*BORDER_WIDTH + TITLE_HEIGHT);
+    XSync(X.disp, False);
 }
 
 void client_close(Client* c)