Exemplo n.º 1
0
Arquivo: tag.c Projeto: kidanger/wmfs
void
uicb_tag_move_client_prev(Uicb cmd)
{
     (void)cmd;
     struct tag *t;

     if(!W->client)
          return;

     if((t = TAILQ_PREV(W->screen->seltag, tsub, next)))
          tag_client(t, W->client);
     else if( /* CIRCULAR OPTION */ 1)
          tag_client(TAILQ_LAST(&W->screen->tags, tsub), W->client);
}
Exemplo n.º 2
0
Arquivo: tag.c Projeto: Engil/wmfs
void
uicb_tag_move_client_next(Uicb cmd)
{
     (void)cmd;
     struct tag *t;

     if(!W->client)
          return;

     if((t = TAILQ_NEXT(W->screen->seltag, next)))
          tag_client(t, W->client);
     else if(W->flags & WMFS_TAGCIRC)
          tag_client(TAILQ_FIRST(&W->screen->tags), W->client);
}
Exemplo n.º 3
0
Arquivo: tag.c Projeto: kidanger/wmfs
void
uicb_tag_move_client_next(Uicb cmd)
{
     (void)cmd;
     struct tag *t;

     if(!W->client)
          return;

     if((t = TAILQ_NEXT(W->screen->seltag, next)))
          tag_client(t, W->client);
     else if( /* CIRCULAR OPTION */ 1)
          tag_client(TAILQ_FIRST(&W->screen->tags), W->client);
}
Exemplo n.º 4
0
Arquivo: tag.c Projeto: kidanger/wmfs
void
tag_screen(struct screen *s, struct tag *t)
{
     struct client *c;

     /* Return to the previous tag */
     if(t == s->seltag && TAILQ_NEXT(TAILQ_FIRST(&s->tags), next))
          t = t->prev;

     if(!t)
          t = TAILQ_FIRST(&s->tags);

     /* Move clients which ignore tags */
     SLIST_FOREACH(c, &W->h.client, next)
          if (c->flags & CLIENT_IGNORE_TAG)
               tag_client(t, c);

     t->prev = s->seltag;
     s->seltag = t;

     clients_arrange_map();

     /* Update focus */
     if(!SLIST_EMPTY(&t->clients) && !(W->flags & WMFS_SCAN))
          client_focus( client_tab_next(t->sel));

     t->flags &= ~TAG_URGENT;

     infobar_elem_screen_update(s, ElemTag);

     ewmh_update_wmfs_props();
}
Exemplo n.º 5
0
Arquivo: tag.c Projeto: kanru/awesome
/** Get or set the clients attached to this tag.
 * \param L The Lua VM state.
 * \return The number of elements pushed on stack.
 * \luastack
 * \lparam None or a table of clients to set.
 * \lreturn A table with the clients attached to this tags.
 */
static int
luaA_tag_clients(lua_State *L)
{
    tag_t **tag = luaA_checkudata(L, 1, "tag");
    client_array_t *clients = &(*tag)->clients;
    int i;

    if(lua_gettop(L) == 2)
    {
        client_t **c;

        luaA_checktable(L, 2);
        for(i = 0; i < (*tag)->clients.len; i++)
            untag_client((*tag)->clients.tab[i], *tag);
        lua_pushnil(L);
        while(lua_next(L, 2))
        {
            c = luaA_checkudata(L, -1, "client");
            tag_client(*c, *tag);
            lua_pop(L, 1);
        }
    }

    luaA_otable_new(L);
    for(i = 0; i < clients->len; i++)
    {
        luaA_client_userdata_new(L, clients->tab[i]);
        lua_rawseti(L, -2, i + 1);
    }

    return 1;
}
Exemplo n.º 6
0
Arquivo: tag.c Projeto: azuwis/awesome
/** Get or set the clients attached to this tag.
 * \param L The Lua VM state.
 * \return The number of elements pushed on stack.
 * \luastack
 * \lparam None or a table of clients to set.
 * \lreturn A table with the clients attached to this tags.
 */
static int
luaA_tag_clients(lua_State *L)
{
    tag_t *tag = luaL_checkudata(L, 1, "tag");
    client_array_t *clients = &tag->clients;
    int i;

    if(lua_gettop(L) == 2)
    {
        luaA_checktable(L, 2);
        foreach(c, tag->clients)
            untag_client(*c, tag);
        lua_pushnil(L);
        while(lua_next(L, 2))
        {
            client_t *c = luaA_client_checkudata(L, -1);
            /* push tag on top of the stack */
            lua_pushvalue(L, 1);
            tag_client(c);
            lua_pop(L, 1);
        }
    }

    lua_createtable(L, clients->len, 0);
    for(i = 0; i < clients->len; i++)
    {
        client_push(L, clients->tab[i]);
        lua_rawseti(L, -2, i + 1);
    }

    return 1;
}
Exemplo n.º 7
0
Arquivo: tag.c Projeto: kidanger/wmfs
/* Set t to NULL to untag c from c->tag */
void
tag_client(struct tag *t, struct client *c)
{
     /* Remove client from its previous tag */
     if(c->tag && !(c->flags & CLIENT_RULED))
     {
          if(c->tag == t)
               return;

          if(!(c->flags & (CLIENT_IGNORE_LAYOUT | CLIENT_FREE)))
               layout_split_arrange_closed(c);

          if(!(c->flags & CLIENT_REMOVEALL))
          {
               SLIST_REMOVE(&c->tag->clients, c, client, tnext);

               if(c->tag->sel == c || W->client == c)
                    client_focus( client_tab_next( client_next(c)));
          }
     }

     c->flags &= ~CLIENT_RULED;

     /* Client remove */
     if(!t)
     {
          infobar_elem_screen_update(c->screen, ElemTag);
          return;
     }

     c->prevtag = c->tag;
     c->tag = t;
     c->screen = t->screen;

     client_update_props(c, CPROP_LOC);

     SLIST_INSERT_HEAD(&t->clients, c, tnext);

     infobar_elem_screen_update(c->screen, ElemTag);

     if(c->flags & CLIENT_TABMASTER && c->prevtag)
     {
          struct client *cc;

          SLIST_FOREACH(cc, &c->prevtag->clients, tnext)
               if(cc->tabmaster == c)
               {
                    cc->flags |= CLIENT_IGNORE_LAYOUT;
                    tag_client(t, cc);
               }
     }

     layout_client(c);

     if(t != c->screen->seltag || c->flags & CLIENT_TABBED)
          client_unmap(c);
}
Exemplo n.º 8
0
Arquivo: tag.c Projeto: kidanger/wmfs
void
uicb_tag_client(Uicb cmd)
{
     struct tag *t;
     int id = ATOI(cmd);

     if(W->client && (t = tag_gb_id(W->screen, id)))
          tag_client(t, W->client);
}
Exemplo n.º 9
0
Arquivo: screen.c Projeto: xorg62/wmfs
void
uicb_screen_move_client_prev(Uicb cmd)
{
     struct screen *s = SLIST_FIRST(&W->h.screen);
     (void)cmd;

     while(SLIST_NEXT(s, next) && SLIST_NEXT(s, next) != s)
          s = SLIST_NEXT(s, next);

     if(W->client)
          tag_client(s->seltag, W->client);
}
Exemplo n.º 10
0
Arquivo: screen.c Projeto: xorg62/wmfs
void
uicb_screen_move_client_next(Uicb cmd)
{
     struct screen *s = SLIST_NEXT(W->screen, next);
     (void)cmd;

     if(!s)
          s = SLIST_FIRST(&W->h.screen);

     if(W->client)
          tag_client(s->seltag, W->client);
}