From: Dana Jansens Date: Mon, 10 Mar 2008 04:40:37 +0000 (-0400) Subject: the xcb_screen_t has extra hidden stuff off the bottom that i need to preserve X-Git-Url: http://git.openbox.org/?p=dana%2Fdcompmgr.git;a=commitdiff_plain;h=0df2f62a4fe2c15e629eb856c3f81e3d5d4f5362 the xcb_screen_t has extra hidden stuff off the bottom that i need to preserve --- diff --git a/dcompmgr.c b/dcompmgr.c index 47c6a1d..0c7ecc9 100644 --- a/dcompmgr.c +++ b/dcompmgr.c @@ -99,7 +99,7 @@ event(d_display_t *dpy) sc = display_screen_from_root(dpy, rev->event); if (!sc) break; w = screen_find_window(sc, rev->window); - if (rev->parent == sc->super.root) + if (rev->parent == sc->super->root) screen_add_window(sc, rev->window); else { if (window_is_mapped(w)) { diff --git a/display.c b/display.c index 8fb74e7..6208655 100644 --- a/display.c +++ b/display.c @@ -449,7 +449,7 @@ display_screen_from_root(d_display_t *dpy, xcb_window_t root) for (it = list_top(dpy->screens); it; it = it->next) { d_screen_t *sc = it->data; - if (sc->super.root == root) + if (sc->super->root == root) return sc; } return NULL; diff --git a/glxrender.c b/glxrender.c index c1058ea..8eb053a 100644 --- a/glxrender.c +++ b/glxrender.c @@ -130,10 +130,10 @@ glxrender_init(d_screen_t *sc, int id) d->context_tag = currep->context_tag; free(currep); - glViewport(0, 0, sc->super.width_in_pixels, sc->super.height_in_pixels); + glViewport(0, 0, sc->super->width_in_pixels, sc->super->height_in_pixels); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0, sc->super.width_in_pixels, sc->super.height_in_pixels, + glOrtho(0, sc->super->width_in_pixels, sc->super->height_in_pixels, 0.0, -1.0, 100.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -271,7 +271,7 @@ glxrender_find_fb_config(d_screen_t *sc, data_t *d) db = 32767; stencil = 32767; depthsize = 32767; - depth_it = xcb_screen_allowed_depths_iterator(&sc->super); + depth_it = xcb_screen_allowed_depths_iterator(sc->super); for (; depth_it.rem; xcb_depth_next(&depth_it)) { uint32_t vid; int j; @@ -602,8 +602,8 @@ glxrender_paint(d_screen_t *sc) window_get_area(w, &x, &y, &width, &height, &bwidth); - if (!(x < sc->super.width_in_pixels && - y < sc->super.height_in_pixels && + if (!(x < sc->super->width_in_pixels && + y < sc->super->height_in_pixels && (x + width > 0 || x + width + d->xshadowoff > 0) && (y + height > 0 || y + height + d->yshadowoff > 0))) { diff --git a/render.c b/render.c index cde867e..552039c 100644 --- a/render.c +++ b/render.c @@ -126,7 +126,7 @@ render_init(d_screen_t *sc, int id) d->pict_formats = xcb_render_query_pict_formats_reply(sc->dpy->conn, ck, NULL); - d->root_format = find_visual_format(d, sc->super.root_visual); + d->root_format = find_visual_format(d, sc->super->root_visual); d->argb32_format = find_argb32_format(d); d->root_picture = XCB_NONE; @@ -137,9 +137,9 @@ render_init(d_screen_t *sc, int id) /* make the double buffer */ px = xcb_generate_id(sc->dpy->conn); - xcb_create_pixmap(sc->dpy->conn, sc->super.root_depth, px, - sc->super.root, sc->super.width_in_pixels, - sc->super.height_in_pixels); + xcb_create_pixmap(sc->dpy->conn, sc->super->root_depth, px, + sc->super->root, sc->super->width_in_pixels, + sc->super->height_in_pixels); d->overlay_buffer = xcb_generate_id(sc->dpy->conn); #ifdef MONITOR_REPAINT xcb_render_create_picture(sc->dpy->conn, @@ -156,8 +156,8 @@ render_init(d_screen_t *sc, int id) d->paint_region = xcb_generate_id(sc->dpy->conn); d->shadow_paint_region = xcb_generate_id(sc->dpy->conn); rect.x = rect.y = 0; - rect.width = sc->super.width_in_pixels; - rect.height = sc->super.height_in_pixels; + rect.width = sc->super->width_in_pixels; + rect.height = sc->super->height_in_pixels; xcb_xfixes_create_region(sc->dpy->conn, d->all_region, 1, &rect); xcb_xfixes_create_region(sc->dpy->conn, d->damaged_region, 1, &rect); xcb_xfixes_create_region(sc->dpy->conn, d->paint_region, 1, &rect); @@ -302,7 +302,7 @@ solid_picture(data_t *d, d_screen_t *sc, uint16_t a, uint16_t r, pixmap = xcb_generate_id(sc->dpy->conn); picture = xcb_generate_id(sc->dpy->conn); - xcb_create_pixmap(sc->dpy->conn, 32, pixmap, sc->super.root, 1, 1); + xcb_create_pixmap(sc->dpy->conn, 32, pixmap, sc->super->root, 1, 1); xcb_render_create_picture(sc->dpy->conn, picture, pixmap, d->argb32_format, XCB_RENDER_CP_REPEAT, &vals); @@ -596,8 +596,8 @@ render_paint(d_screen_t *sc) window_get_area(w, &x, &y, &width, &height, &bwidth); - if (!(x < sc->super.width_in_pixels && - y < sc->super.height_in_pixels && + if (!(x < sc->super->width_in_pixels && + y < sc->super->height_in_pixels && x + width > 0 && y + height > 0)) { continue; @@ -647,8 +647,8 @@ render_paint(d_screen_t *sc) window_get_area(w, &x, &y, &width, &height, &bwidth); - if (!(x < sc->super.width_in_pixels && - y < sc->super.height_in_pixels && + if (!(x < sc->super->width_in_pixels && + y < sc->super->height_in_pixels && (x + width > 0 || x + width + d->xshadowoff > 0) && (y + height > 0 || y + height + d->yshadowoff > 0))) { @@ -699,8 +699,8 @@ render_paint(d_screen_t *sc) d->overlay_picture, 0, 0, 0, 0, 0, 0, - sc->super.width_in_pixels, - sc->super.height_in_pixels); + sc->super->width_in_pixels, + sc->super->height_in_pixels); #endif /* empty the damaged region */ @@ -736,8 +736,8 @@ paint_root(d_screen_t *sc, data_t *d) d->overlay_buffer, 0, 0, 0, 0, 0, 0, - sc->super.width_in_pixels, - sc->super.height_in_pixels); + sc->super->width_in_pixels, + sc->super->height_in_pixels); } static void diff --git a/screen.c b/screen.c index 3048703..91b1975 100644 --- a/screen.c +++ b/screen.c @@ -37,7 +37,7 @@ screen_new(struct d_display *dpy, int num, xcb_screen_t *xcb) d_screen_t *sc; sc = malloc(sizeof(d_screen_t)); - sc->super = *xcb; + sc->super = xcb; sc->ref = 1; sc->dpy = dpy; sc->num = num; @@ -92,9 +92,9 @@ screen_register(d_screen_t *sc) w = xcb_generate_id(sc->dpy->conn); event_mask = SELECTION_MASK; - xcb_create_window(sc->dpy->conn, XCB_COPY_FROM_PARENT, w, sc->super.root, + xcb_create_window(sc->dpy->conn, XCB_COPY_FROM_PARENT, w, sc->super->root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY, - sc->super.root_visual, XCB_CW_EVENT_MASK, &event_mask); + sc->super->root_visual, XCB_CW_EVENT_MASK, &event_mask); name = g_strdup_printf("_NET_WM_CM_S%d", sc->num); ack = xcb_intern_atom(sc->dpy->conn, FALSE, strlen(name), name); @@ -152,16 +152,16 @@ screen_init(d_screen_t *sc) xcb_composite_get_overlay_window_reply_t *overlay_rep; redir_ck = - xcb_composite_redirect_subwindows(sc->dpy->conn, sc->super.root, + xcb_composite_redirect_subwindows(sc->dpy->conn, sc->super->root, XCB_COMPOSITE_REDIRECT_AUTOMATIC); #if 1 redir_ck = - xcb_composite_redirect_subwindows(sc->dpy->conn, sc->super.root, + xcb_composite_redirect_subwindows(sc->dpy->conn, sc->super->root, XCB_COMPOSITE_REDIRECT_MANUAL); overlay_ck = xcb_composite_get_overlay_window(sc->dpy->conn, - sc->super.root); + sc->super->root); /* check that the redirect worked */ err = xcb_request_check(sc->dpy->conn, redir_ck); @@ -216,7 +216,7 @@ screen_init(d_screen_t *sc) xcb_change_window_attributes(sc->dpy->conn, sc->selwin, XCB_CW_EVENT_MASK, &mask); mask = ROOT_MASK; - xcb_change_window_attributes(sc->dpy->conn, sc->super.root, + xcb_change_window_attributes(sc->dpy->conn, sc->super->root, XCB_CW_EVENT_MASK, &mask); screen_update_root_pixmap(sc); @@ -241,15 +241,15 @@ screen_update_root_pixmap(d_screen_t *sc) } sc->root_pixmap_ck[0] = xcb_get_property_unchecked(sc->dpy->conn, FALSE, - sc->super.root, sc->dpy->a.xrootpmap_id, + sc->super->root, sc->dpy->a.xrootpmap_id, sc->dpy->a.pixmap, 0, 1); sc->root_pixmap_ck[1] = xcb_get_property_unchecked(sc->dpy->conn, FALSE, - sc->super.root, sc->dpy->a.esetroot_pmap_id, + sc->super->root,sc->dpy->a.esetroot_pmap_id, sc->dpy->a.pixmap, 0, 1); sc->root_pixmap_ck[2] = xcb_get_property_unchecked(sc->dpy->conn, FALSE, - sc->super.root, sc->dpy->a.xsetroot_id, + sc->super->root, sc->dpy->a.xsetroot_id, sc->dpy->a.pixmap, 0, 1); sc->root_pixmap_waiting = TRUE; } @@ -274,7 +274,7 @@ screen_add_existing_windows(d_screen_t *sc) xcb_query_tree_cookie_t ck; xcb_query_tree_reply_t *rep; - ck = xcb_query_tree(sc->dpy->conn, sc->super.root); + ck = xcb_query_tree(sc->dpy->conn, sc->super->root); rep = xcb_query_tree_reply(sc->dpy->conn, ck, NULL); if (rep) { xcb_window_iterator_t it; diff --git a/screen.h b/screen.h index 12fe915..9c4fb75 100644 --- a/screen.h +++ b/screen.h @@ -11,7 +11,7 @@ struct d_list; /* inherits from xcb_screen_t */ typedef struct d_screen { - xcb_screen_t super; + xcb_screen_t *super; int ref; struct d_display *dpy; int num;