From: Michael D. Lowis Date: Wed, 8 Apr 2020 20:34:43 +0000 (-0400) Subject: fixed minor bug with shaded windows X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=aea726bab6924ce05f47817ef1cdacc8dd798541;p=proto%2Fanvil.git fixed minor bug with shaded windows --- diff --git a/anvil.c b/anvil.c index 06c66f1..f5fb6eb 100644 --- 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; diff --git a/client.c b/client.c index 55fd9a1..87e0fa3 100644 --- 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 5089163..6870c41 100644 --- 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 8b027e5..66eae41 100644 --- 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); } }