Exemple #1
0
static void set_toplevel(struct wl_client * client,
                         struct wl_resource * resource)
{
    struct shell_surface * shell_surface = wl_resource_get_user_data(resource);

    window_manage(&shell_surface->window);
    window_set_parent(&shell_surface->window, NULL);
}
Exemple #2
0
static void set_maximized(struct wl_client * client,
                          struct wl_resource * resource,
                          struct wl_resource * output_resource)
{
    struct shell_surface * shell_surface = wl_resource_get_user_data(resource);

    /* TODO: Handle maximized windows. */

    window_manage(&shell_surface->window);
    window_set_parent(&shell_surface->window, NULL);
}
Exemple #3
0
static void set_transient(struct wl_client * client,
                          struct wl_resource * resource,
                          struct wl_resource * parent_resource,
                          int32_t x, int32_t y, uint32_t flags)
{
    struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
    struct swc_surface * parent_surface
        = wl_resource_get_user_data(parent_resource);
    struct compositor_view * parent_view
        = compositor_view(parent_surface->view);

    if (!parent_view || !parent_view->window)
        return;

    window_manage(&shell_surface->window);
    window_set_parent(&shell_surface->window, parent_view->window);
}
Exemple #4
0
static void set_fullscreen(struct wl_client * client,
                           struct wl_resource * resource,
                           uint32_t method, uint32_t framerate,
                           struct wl_resource * output_resource)
{
    struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
    struct swc_output * output = output_resource
        ? wl_resource_get_user_data(output_resource) : NULL;
    struct screen * screen;

    screen = output ? output->screen
                    : wl_container_of(swc.screens.next, screen, link);

    /* TODO: Handle fullscreen windows. */

    window_manage(&shell_surface->window);
    window_set_parent(&shell_surface->window, NULL);
}
Exemple #5
0
void window_manage_all(void)
{
    guint i, j, nchild;
    Window w, *children;
    XWMHints *wmhints;
    XWindowAttributes attrib;

    if (!XQueryTree(obt_display, RootWindow(obt_display, ob_screen),
                    &w, &w, &children, &nchild)) {
        ob_debug("XQueryTree failed in window_manage_all");
        nchild = 0;
    }

    /* remove all icon windows from the list */
    for (i = 0; i < nchild; i++) {
        if (children[i] == None) continue;
        wmhints = XGetWMHints(obt_display, children[i]);
        if (wmhints) {
            if ((wmhints->flags & IconWindowHint) &&
                (wmhints->icon_window != children[i]))
                for (j = 0; j < nchild; j++)
                    if (children[j] == wmhints->icon_window) {
                        /* XXX watch the window though */
                        children[j] = None;
                        break;
                    }
            XFree(wmhints);
        }
    }

    for (i = 0; i < nchild; ++i) {
        if (children[i] == None) continue;
        if (window_find(children[i])) continue; /* skip our own windows */
        if (XGetWindowAttributes(obt_display, children[i], &attrib)) {
            if (attrib.map_state == IsUnmapped)
                ;
            else
                window_manage(children[i]);
        }
    }

    if (children) XFree(children);
}
Exemple #6
0
void window_manage_all(void)
{
	guint i, j, nchild;
	Window w, *children;
	XWMHints *wmhints;
	XWindowAttributes attrib;
	if(!XQueryTree(t_display, DefaultRootWindow(t_display), &w, &w, &children, &nchild)) {
		wm_debug("XQueryTree failed in window_manage_all");
		nchild = 0;
	}
	for(i = 0; i < nchild; i++) {
		if(children[i] == None)
			continue;
		wmhints = XGetWMHints(t_display, children[i]);
		if(wmhints) {
			if((wmhints->flags & IconWindowHint) && (wmhints->icon_window != children[i]))
				for(j = 0; j < nchild; j++)
					if(children[j] == wmhints->icon_window) {
						children[j] = None;
						break;
					}
			XFree(wmhints);
		}
	}
	for(i = 0; i < nchild; ++i) {
		if(children[i] == None)
			continue;
		if(window_find(children[i]))
			continue;
		if(XGetWindowAttributes(t_display, children[i], &attrib)) {
			if(attrib.map_state == IsUnmapped);
			else
				window_manage(children[i]);
		}
	}
	if(children)
		XFree(children);
}