Пример #1
0
void
mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
{
    struct screen_ctx	*sc = cc->sc;
    struct client_ctx	*old_cc;
    struct menu		*mi;
    struct menu_q		 menuq;
    char			*wname;

    old_cc = client_current();

    TAILQ_INIT(&menuq);
    TAILQ_FOREACH(cc, &Clientq, entry)
    if (cc->flags & CLIENT_HIDDEN) {
        wname = (cc->label) ? cc->label : cc->name;
        if (wname == NULL)
            continue;

        menuq_add(&menuq, cc, "(%d) %s",
                  cc->group->shortcut, wname);
    }

    if (TAILQ_EMPTY(&menuq))
        return;

    if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
                          NULL, NULL)) != NULL) {
        cc = (struct client_ctx *)mi->ctx;
        client_unhide(cc);

        if (old_cc != NULL)
            client_ptrsave(old_cc);
        client_ptrwarp(cc);
    }

    menuq_clear(&menuq);
}
Пример #2
0
/** Arrange All
*/
void
arrange(int screen, Bool update_layout)
{
     Client *c;

     if(screen < 0 || screen > screen_count() - 1)
          screen = screen_get_sel();

     for(c = clients; c; c = c->next)
          if(c->screen == screen)
          {
               if(!ishide(c, screen))
                    client_unhide(c);
               else
                    client_hide(c);
          }

     if(update_layout)
          tags[screen][seltag[screen]].layout.func(screen);

     infobar_draw(screen);

     return;
}
Пример #3
0
/** Clean wmfs before the exit
 */
void
quit(void)
{
     Client *c;
     size_t i, len;

     /* Set the silent error handler */
     XSetErrorHandler(errorhandlerdummy);

     /* Unmanage all clients */
     for(c = clients; c; c = c->next)
     {
          client_unhide(c);
          XReparentWindow(dpy, c->win, ROOT, c->geo.x, c->geo.y);
     }

     free(tags);
     free(seltag);

     systray_freeicons();

     XftFontClose(dpy, font);
     for(i = 0; i < CurLast; ++i)
          XFreeCursor(dpy, cursor[i]);
     XFreeGC(dpy, gc_stipple);
     infobar_destroy();

     free(sgeo);
     free(spgeo);
     free(infobar);
     free(keys);
     free(net_atom);

     /* Clean conf alloced thing */
     free(menulayout.item);

     if(conf.menu)
     {
          len = LEN(conf.menu);
          for(i = 0; i < len; ++i)
               free(conf.menu[i].item);
          free(conf.menu);
     }

     free(conf.launcher);
     free(conf.rule);

     free(conf.bars.mouse);
     free(conf.selbar.mouse);
     free(conf.titlebar.button);
     free(conf.client.mouse);
     free(conf.root.mouse);

     free_conf();

     XSync(dpy, False);
     XCloseDisplay(dpy);

     /* kill status script */
     if (conf.status_pid != (pid_t)-1)
         kill(conf.status_pid, SIGTERM);

     return;
}