Skip to content
Browse files

fix client integration on the screen

  • Loading branch information...
1 parent c692505 commit e65c6a706ac152b7846d001fb21951f4ff7fafa8 @kidanger kidanger committed Apr 13, 2012
Showing with 12 additions and 6 deletions.
  1. +1 −1 src/client.c
  2. +5 −2 src/client.h
  3. +6 −3 src/layout.c
View
2 src/client.c
@@ -549,7 +549,7 @@ _client_tab(struct client *c, struct client *cm)
/* Do not tab already tabbed client */
if(c->flags & (CLIENT_TABBED | CLIENT_TABMASTER)
|| c->tag != cm->tag || c == cm
- || (c->flags & CLIENT_IGNORE_TAG) != (cm->flags & CLIENT_IGNORE_TAG))
+ || !COMPCLIENT(c, cm))
return;
layout_split_arrange_closed(c);
View
7 src/client.h
@@ -18,6 +18,9 @@
SLIST_FOREACH(V, H, F) \
if(!(V->flags & CLIENT_FREE))
+/* Are two clients compatibles ? (to be tabbed together) */
+#define COMPCLIENT(C1, C2) ((C1->flags & CLIENT_IGNORE_TAG) == (C2->flags & CLIENT_IGNORE_TAG))
+
void client_configure(struct client *c);
struct client *client_gb_win(Window w);
struct client *client_gb_frame(Window w);
@@ -188,14 +191,14 @@ clients_tag_arrange_map(struct tag *t)
}
static inline struct client*
-client_get_larger(struct tag *t)
+client_get_larger(struct tag *t, bool ignoring_tag)
{
struct client *c, *lc = NULL;
int tmp, l = 0;
FOREACH_NFCLIENT(c, &t->clients, tnext)
{
- if((tmp = (c->geo.w + c->geo.h)) > l)
+ if((tmp = (c->geo.w + c->geo.h)) > l && (c->flags & CLIENT_IGNORE_TAG) == ignoring_tag)
{
l = tmp;
lc = c;
View
9 src/layout.c
@@ -395,8 +395,9 @@ layout_split_integrate(struct client *c, struct client *sc)
if(!sc
|| sc == c
|| sc->tag != c->tag
- || (sc->flags & CLIENT_FREE))
- sc = client_get_larger(c->tag);
+ || (sc->flags & CLIENT_FREE)
+ || !COMPCLIENT(c, sc))
+ sc = client_get_larger(c->tag, c->flags & CLIENT_IGNORE_TAG);
/* Largest not correct */
if(!sc || sc == c)
@@ -419,13 +420,14 @@ layout_split_integrate(struct client *c, struct client *sc)
}
/* Tab Next Opened Client option */
- if(W->flags & WMFS_TABNOC)
+ if(W->flags & WMFS_TABNOC && COMPCLIENT(c, sc))
{
W->flags ^= WMFS_TABNOC;
_client_tab(c, sc);
return;
}
+ /* If there are clients but we can tab with them, split the screen. */
c->flags |= CLIENT_TILED;
g = layout_split(sc, (sc->geo.h < sc->geo.w));
@@ -437,6 +439,7 @@ layout_split_integrate(struct client *c, struct client *sc)
client_fac_hint(sc);
layout_save_set(c->tag);
+ W->flags &= ~WMFS_TABNOC;
}
/* Arrange inter-clients holes:

0 comments on commit e65c6a7

Please sign in to comment.
Something went wrong with that request. Please try again.