コード例 #1
0
static void menu_execute(ObMenuEntry *self, ObMenuFrame *f,
                         ObClient *c, guint state, gpointer data)
{
    if (self->id == ADD_DESKTOP) {
        screen_add_desktop(FALSE);
        menu_frame_hide_all();
    }
    else if (self->id == REMOVE_DESKTOP) {
        screen_remove_desktop(FALSE);
        menu_frame_hide_all();
    }
    else {
        ObClient *t = self->data.normal.data;
        if (t) { /* it's set to NULL if its destroyed */
            gboolean here = state & ShiftMask;

            if (state & ShiftMask) {
                client_close(t);
                self->data.normal.enabled = FALSE;
            }
            else {
                client_activate(t, TRUE, here, TRUE, TRUE, TRUE);

                /* if the window is omnipresent then we need to go to its
                   desktop */
                if (!here && t->desktop == DESKTOP_ALL)
                    screen_set_desktop(self->id, FALSE);
            }
        }
        else
            screen_set_desktop(self->id, TRUE);
    }
}
コード例 #2
0
ファイル: client_list_menu.c プロジェクト: richo/openbox
static void self_execute(ObMenuEntry *self, ObMenuFrame *f,
                         ObClient *c, guint state, gpointer data)
{
    if (self->id == ADD_DESKTOP) {
        screen_add_desktop(FALSE);
        menu_frame_hide_all();
    }
    else if (self->id == REMOVE_DESKTOP) {
        screen_remove_desktop(FALSE);
        menu_frame_hide_all();
    }
}
コード例 #3
0
ファイル: addremovedesktop.c プロジェクト: godvmxi/obwm
/* Always return FALSE because its not interactive */
static gboolean run_func(ObActionsData *data, gpointer options)
{
    Options *o = options;

    actions_client_move(data, TRUE);

    if (o->add)
        screen_add_desktop(o->current);
    else
        screen_remove_desktop(o->current);

    actions_client_move(data, FALSE);

    return FALSE;
}