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)) {
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;
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();
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;
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)))
{
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;
/* 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,
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);
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);
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;
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)))
{
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 */
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
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;
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);
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);
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);
}
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;
}
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;
/* 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;