Exemplo n.º 1
0
void stacking_add_nonintrusive(struct wm_window *win)
{
	struct wm_client *client;
	GList *it_below = NULL;
	GList *it_above;
	GList *wins;
	if(!WINDOW_IS_CLIENT(win)) {
		stacking_add(win);
		return;
	}
	client = WINDOW_AS_CLIENT(win);
	g_assert(client->managed);
	it_below = find_highest_relative(client);
	if(!it_below) {
		if(focus_client && client != focus_client && focus_client->layer == client->layer) {
			it_below = g_list_find(stacking_list, focus_client);
			it_below = g_list_next(it_below);
		} else {
			it_below = stacking_list;
		}
	}
	for(; it_below; it_below = g_list_next(it_below)) {
		if(client->layer >= window_layer(it_below->data))
			break;
	}
	for(; it_below != stacking_list; it_below = it_above) {
		it_above = it_below ? g_list_previous(it_below) : g_list_last(stacking_list);
		if(client->layer <= window_layer(it_above->data))
			break;
	}
	wins = g_list_append(NULL, win);
	do_restack(wins, it_below);
	g_list_free(wins);
	stacking_list_tail = g_list_last(stacking_list);
}
Exemplo n.º 2
0
void stacking_add(struct wm_window *win)
{
	g_assert(screen_support_win != None);
	if(WINDOW_IS_CLIENT(win))
		g_assert(WINDOW_AS_CLIENT(win)->managed);
	stacking_list = g_list_append(stacking_list, win);
	stacking_raise(win);
}
Exemplo n.º 3
0
Window window_top(struct wm_window *self)
{
	switch (self->type) {
	case WM_WINDOW_CLASS_CLIENT:
		return WINDOW_AS_CLIENT(self)->frame->window;
	case WM_WINDOW_CLASS_INTERNAL:
		return WINDOW_AS_INTERNAL(self)->window;
	}
	g_assert_not_reached();
	return None;
}
Exemplo n.º 4
0
void stacking_lower(struct wm_window *window)
{
	if(WINDOW_IS_CLIENT(window)) {
		struct wm_client *selected;
		selected = WINDOW_AS_CLIENT(window);
		restack_windows(selected, FALSE);
	} else {
		GList *wins;
		wins = g_list_append(NULL, window);
		stacking_list = g_list_remove(stacking_list, window);
		do_lower(wins);
		g_list_free(wins);
	} stacking_list_tail = g_list_last(stacking_list);
}
Exemplo n.º 5
0
Window window_top(ObWindow *self)
{
    switch (self->type) {
    case OB_WINDOW_CLASS_MENUFRAME:
        return WINDOW_AS_MENUFRAME(self)->window;
    case OB_WINDOW_CLASS_DOCK:
        return WINDOW_AS_DOCK(self)->frame;
    case OB_WINDOW_CLASS_CLIENT:
        return WINDOW_AS_CLIENT(self)->frame->window;
    case OB_WINDOW_CLASS_INTERNAL:
        return WINDOW_AS_INTERNAL(self)->window;
    case OB_WINDOW_CLASS_PROMPT:
        return WINDOW_AS_PROMPT(self)->super.window;
    }
    g_assert_not_reached();
    return None;
}