Fix client flick at untab when free, split arrange closed with free mode

This commit is contained in:
Martin Duquesnoy 2012-01-29 05:18:51 +01:00
parent 3361a3b8bc
commit 8f52715fe3
4 changed files with 11 additions and 1 deletions

View File

@ -559,6 +559,7 @@ client_untab(struct client *c)
{ {
client_tab_focus(cc); client_tab_focus(cc);
c->flags &= ~CLIENT_TABBED; c->flags &= ~CLIENT_TABBED;
c->flags |= CLIENT_IGNORE_ENTER;
c->tabmaster = NULL; c->tabmaster = NULL;
/* Looking for tabbed client in cc, if there is not /* Looking for tabbed client in cc, if there is not
@ -618,7 +619,10 @@ client_focus(struct client *c)
if(c->flags & CLIENT_FREE if(c->flags & CLIENT_FREE
&& !(c->flags & (CLIENT_FULLSCREEN | CLIENT_TABBED))) && !(c->flags & (CLIENT_FULLSCREEN | CLIENT_TABBED)))
{
c->tag->flags |= CLIENT_IGNORE_ENTER;
XRaiseWindow(W->dpy, c->frame); XRaiseWindow(W->dpy, c->frame);
}
XSetInputFocus(W->dpy, c->win, RevertToPointerRoot, CurrentTime); XSetInputFocus(W->dpy, c->win, RevertToPointerRoot, CurrentTime);
} }

View File

@ -64,6 +64,8 @@ event_enternotify(XEvent *e)
{ {
if(c->flags & CLIENT_IGNORE_ENTER) if(c->flags & CLIENT_IGNORE_ENTER)
c->flags ^= CLIENT_IGNORE_ENTER; c->flags ^= CLIENT_IGNORE_ENTER;
else if(c->tag->flags & TAG_IGNORE_ENTER)
c->tag->flags ^= TAG_IGNORE_ENTER;
else if(c != W->client && !(c->flags & CLIENT_TABBED)) else if(c != W->client && !(c->flags & CLIENT_TABBED))
client_focus(c); client_focus(c);
} }

View File

@ -319,6 +319,9 @@ layout_split_arrange_closed(struct client *ghost)
bool b = false; bool b = false;
enum position p; enum position p;
if(!(ghost->flags & CLIENT_TILED))
return;
/* Search for single parent for easy resize /* Search for single parent for easy resize
* Example case: * Example case:
* ___________ ___________ * ___________ ___________

View File

@ -165,7 +165,8 @@ struct tag
struct tag *prev; struct tag *prev;
char *name; char *name;
int id; int id;
#define TAG_URGENT 0x01 #define TAG_URGENT 0x01
#define TAG_IGNORE_ENTER 0x02
Flags flags; Flags flags;
SLIST_HEAD(, client) clients; SLIST_HEAD(, client) clients;
TAILQ_HEAD(ssub, layout_set) sets; TAILQ_HEAD(ssub, layout_set) sets;