]> git.mdlowis.com Git - proto/anvil.git/commitdiff
fixed minor bug with shaded windows
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 8 Apr 2020 20:34:43 +0000 (16:34 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 8 Apr 2020 20:34:43 +0000 (16:34 -0400)
anvil.c
client.c
mons.c
tile.c

diff --git a/anvil.c b/anvil.c
index 06c66f156129e91ac33be1ce91b6a8c6002c2312..f5fb6eb94321aae00148191c263e9c498d852ecd 100644 (file)
--- a/anvil.c
+++ b/anvil.c
@@ -180,8 +180,15 @@ static void xenternotify(XEvent* e)
     Location loc = {0};
     if (mons_find(ev->window, &loc))
     {
-        printf("ENTER(w: 0x%lx c: 0x%lx)\n", ev->window, loc.client->win);
-        client_focus(loc.client);
+        printf("ENTER(w: 0x%lx c: 0x%lx s: %d m: %d d: %d)\n", ev->window, loc.client->win, ev->state, ev->mode, ev->detail);
+        if (!ev->state && !ev->mode)
+        {
+            client_focus(loc.client);
+        }
+        else
+        {
+            //XSetInputFocus(X.disp, loc.client->frame, RevertToPointerRoot, CurrentTime);
+        }
     }
 }
 
@@ -279,7 +286,6 @@ int main(void)
         {
             X.eventfns[ev.type](&ev);
         }
-        XSync(X.disp, False);
     }
 
     return 0;
index 55fd9a13692fe5e412ec5150acc0c5431bb054f3..87e0fa3d9a912c8a6e726596b0ff48fd2b1e8e7f 100644 (file)
--- a/client.c
+++ b/client.c
@@ -80,7 +80,8 @@ void client_draw(Client* c)
 void client_adjust(Client* c)
 {
     int shaded = (c->flags & F_SHADED);
-    int minheight = (shaded ? MIN_HEIGHT : 3*MIN_HEIGHT);
+    int floating = (c->flags & (F_DIALOG|F_FLOATING));
+    int minheight = (shaded || !floating ? MIN_HEIGHT : 3*MIN_HEIGHT);
     if (c->w < minheight) c->w = minheight;
     if (c->h < minheight) c->h = minheight;
     XMoveResizeWindow(X.disp, c->frame, c->x, c->y, c->w, (shaded ? minheight : c->h));
diff --git a/mons.c b/mons.c
index 50891630724c7825e75b25bc3335601678988ffb..6870c41d2f243025fa9a41c319c1f3864660e165 100644 (file)
--- a/mons.c
+++ b/mons.c
@@ -465,7 +465,6 @@ static void add_client(Monitor* mon, Client* c, int ptrx)
         }
     }
     mons_layer(mon);
-    XSync(X.disp, False);
 }
 
 static void remove_client(Location* loc, Client* c)
diff --git a/tile.c b/tile.c
index 8b027e5ab0c3e48c52e8e35fd1e4d2175f4f0bdd..66eae41d3b99639eedf84ee67293e20319241364 100644 (file)
--- a/tile.c
+++ b/tile.c
@@ -164,7 +164,6 @@ void stacked_addheight(Location* loc, int amount)
         client_setshade(prev, (prev->h <= MIN_HEIGHT));
         client_setshade(c, (c->h <= MIN_HEIGHT));
         client_adjust(prev);
-        mouse_totitle(c);
         client_adjust(c);
     }
 }