Esempio n. 1
0
void actions_client_move(ObActionsData *data, gboolean start)
{
    static gulong ignore_start = 0;
    if (start)
        ignore_start = event_start_ignore_all_enters();
    else if (config_focus_follow &&
             data->context != OB_FRAME_CONTEXT_CLIENT)
    {
        if (data->uact == OB_USER_ACTION_MOUSE_PRESS) {
            struct _ObClient *c;
			syslog(LOG_INFO,"client move");
            /* usually this is sorta redundant, but with a press action
               that moves windows our from under the cursor, the enter
               event will come as a GrabNotify which is ignored, so this
               makes a fake enter event

               don't do this if there is a grab on the pointer.  enter events
               are ignored during a grab, so don't force fake ones when they
               should be ignored
            */
            if ((c = client_under_pointer()) && c != data->client &&
                !grab_on_pointer())
            {
                ob_debug_type(OB_DEBUG_FOCUS,
                              "Generating fake enter because we did a "
                              "mouse-event action");
                event_enter_client(c);
            }
        }
        else if (!data->button && !config_focus_under_mouse)
            event_end_ignore_all_enters(ignore_start);
    }
}
Esempio n. 2
0
void stacking_restore(void)
{
	Window *win;
	GList *it;
	gint i;
	gulong start;
	win = g_new(Window, g_list_length(stacking_list) + 1);
	win[0] = screen_support_win;
	for(i = 1, it = stacking_list; it; ++i, it = g_list_next(it))
		win[i] = window_top(it->data);
	start = event_start_ignore_all_enters();
	XRestackWindows(t_display, win, i);
	event_end_ignore_all_enters(start);
	g_free(win);
	pause_changes = FALSE;
}
Esempio n. 3
0
void popup_hide(ObPopup *self)
{
    if (self->mapped) {
        gulong ignore_start;

        /* kill enter events cause by this unmapping */
        ignore_start = event_start_ignore_all_enters();

        XUnmapWindow(obt_display, self->bg);
        self->mapped = FALSE;

        event_end_ignore_all_enters(ignore_start);
    } else if (self->delay_mapped) {
        obt_main_loop_timeout_remove_data(ob_main_loop, popup_show_timeout, self, FALSE);
        self->delay_mapped = FALSE;
    }
}
Esempio n. 4
0
void popup_hide(ObPopup *self)
{
    if (self->mapped) {
        gulong ignore_start;

        /* kill enter events cause by this unmapping */
        ignore_start = event_start_ignore_all_enters();

        XUnmapWindow(obt_display, self->bg);
        self->mapped = FALSE;

        event_end_ignore_all_enters(ignore_start);
    } else if (self->delay_mapped) {
        g_source_remove(self->delay_timer);
        self->delay_timer = 0;
        self->delay_mapped = FALSE;
    }
}
Esempio n. 5
0
void stacking_temp_raise(struct wm_window *window)
{
	Window win[2];
	GList *it;
	gulong start;
	g_assert(window_layer(window) < WM_STACKING_LAYER_INTERNAL);
	win[0] = screen_support_win;
	for(it = stacking_list; it; it = g_list_next(it)) {
		struct wm_window *w = it->data;
		if(window_layer(w) >= WM_STACKING_LAYER_INTERNAL)
			win[0] = window_top(w);
		else
			break;
	}
	win[1] = window_top(window);
	start = event_start_ignore_all_enters();
	XRestackWindows(t_display, win, 2);
	event_end_ignore_all_enters(start);
	pause_changes = TRUE;
}
Esempio n. 6
0
static void menu_frame_hide(ObMenuFrame *self)
{
    ObMenu *const menu = self->menu;
    GList *it = g_list_find(menu_frame_visible, self);
    gulong ignore_start;

    if (!it)
        return;

    if (menu->hide_func)
        menu->hide_func(self, menu->data);

    if (self->child)
        menu_frame_hide(self->child);

    if (self->parent) {
        remove_submenu_hide_timeout(self);

        self->parent->child = NULL;
        self->parent->child_entry = NULL;
    }
    self->parent = NULL;
    self->parent_entry = NULL;

    menu_frame_visible = g_list_delete_link(menu_frame_visible, it);

    if (menu_frame_visible == NULL) {
        /* last menu shown */
        ungrab_pointer();
        ungrab_keyboard();
    }

    ignore_start = event_start_ignore_all_enters();
    XUnmapWindow(obt_display, self->window);
    event_end_ignore_all_enters(ignore_start);

    menu_frame_free(self);

    if (menu->cleanup_func)
        menu->cleanup_func(menu, menu->data);
}