Ejemplo n.º 1
0
/** Call before exiting.
 */
void
awesome_atexit(bool restart)
{
    int screen_nbr, nscreens;

    if(globalconf.hooks.exit != LUA_REFNIL)
        luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.exit, 0, 0);

    lua_pushboolean(globalconf.L, restart);
    signal_object_emit(globalconf.L, &global_signals, "exit", 1);

    a_dbus_cleanup();

    /* do this only for real screen */
    const xcb_setup_t *setup = xcb_get_setup(globalconf.connection);
    nscreens = setup ? xcb_setup_roots_length(setup) : -1;
    for(screen_nbr = 0;
        screen_nbr < nscreens;
        screen_nbr++)
        systray_cleanup(0, screen_nbr); //FIXME: Clean physical screens

    /* Close Lua */
    lua_close(globalconf.L);

    xcb_flush(globalconf.connection);

    /* Disconnect *after* closing lua */
    xcb_disconnect(globalconf.connection);

    ev_default_destroy();
}
Ejemplo n.º 2
0
/** Kick out systray windows.
 */
static void
drawin_systray_kickout(drawin_t *w)
{
    if(globalconf.systray.parent == w)
    {
        /* Who! Check that we're not deleting a drawin with a systray, because it
         * may be its parent. If so, we reparent to root before, otherwise it will
         * hurt very much. */
        systray_cleanup();
        xcb_reparent_window(globalconf.connection,
                            globalconf.systray.window,
                            globalconf.screen->root,
                            -512, -512);

        globalconf.systray.parent = NULL;
    }
}
Ejemplo n.º 3
0
/** Refresh all systrays registrations per physical screen
 */
void
systray_refresh()
{
    int nscreen = xcb_setup_roots_length(xcb_get_setup(globalconf.connection));

    for(int phys_screen = 0; phys_screen < nscreen; phys_screen++)
    {
        bool has_systray = false;
        foreach(w, globalconf.wiboxes)
            if(phys_screen == (*w)->ctx.phys_screen && (*w)->has_systray)
                /* Can't use "break" with foreach() :( */
                has_systray = true;

        if(has_systray)
            systray_register(phys_screen);
        else
            systray_cleanup(phys_screen);
    }
}
Ejemplo n.º 4
0
/** Call before exiting.
 */
void
awesome_atexit(bool restart)
{
    lua_pushboolean(globalconf.L, restart);
    signal_object_emit(globalconf.L, &global_signals, "exit", 1);

    a_dbus_cleanup();

    systray_cleanup();

    /* Close Lua */
    lua_close(globalconf.L);

    xcb_flush(globalconf.connection);

    /* Disconnect *after* closing lua */
    xcb_disconnect(globalconf.connection);

    ev_default_destroy();
}