From 07613beed87ac8110a6871fafedcca9e2bd049ad Mon Sep 17 00:00:00 2001 From: sasha Date: Thu, 26 Jul 2007 16:17:50 +0000 Subject: [PATCH] fixed libAI usage for multi-display - requires new libAfterImage from CVS - version 1.15 --- src/init.C | 4 +--- src/rxvt.h | 4 ---- src/xpm.C | 12 ++++++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/init.C b/src/init.C index 987eaa94..86f641bd 100644 --- a/src/init.C +++ b/src/init.C @@ -319,9 +319,7 @@ rxvt_term::init_resources (int argc, const char *const *argv) #endif #ifdef HAVE_AFTERIMAGE - //TODO: why set it to 0 and then to dpy? - ::dpy = NULL; /* init global var from libAfter... */ - asv = AFTERIMAGE_DPY_OP (create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL)); + asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); #endif free (r_argv); diff --git a/src/rxvt.h b/src/rxvt.h index 4eb6a80a..e1c7c2c0 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -885,10 +885,6 @@ extern class rxvt_composite_vec rxvt_composite; class keyboard_manager; #endif -/* to get libAfterImage to work with multiple displays we use that hack : */ -/* should not need that with libAfterImage version >= 1.15 */ -#define AFTERIMAGE_DPY_OP(op) ((::dpy = dpy), (op)) - struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { // special markers with magic addresses diff --git a/src/xpm.C b/src/xpm.C index 475e0b77..f41d917e 100644 --- a/src/xpm.C +++ b/src/xpm.C @@ -393,7 +393,7 @@ rxvt_term::resize_pixmap () ASImage *scaled_im = scale_asimage (asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT); if (scaled_im) { - pixmap = AFTERIMAGE_DPY_OP (asimage2pixmap(asv, display->root, scaled_im, gc, True)); + pixmap = asimage2pixmap(asv, display->root, scaled_im, gc, True); destroy_asimage (&scaled_im); } } @@ -493,7 +493,7 @@ rxvt_term::set_bgPixmap (const char *file) } if (original_asim) { - bgPixmap.pixmap = AFTERIMAGE_DPY_OP (asimage2pixmap (asv, display->root, original_asim, NULL, True)); + bgPixmap.pixmap = asimage2pixmap (asv, display->root, original_asim, NULL, True); xpmAttr.width = original_asim->width ; xpmAttr.height = original_asim->height ; } @@ -865,7 +865,7 @@ rxvt_term::check_our_parents_cb (time_watcher &w) ARGB32 tint ; unsigned int pmap_w = 0, pmap_h = 0; - if (get_drawable_size( rootpixmap, &pmap_w, &pmap_h )) + if (get_dpy_drawable_size( dpy, rootpixmap, &pmap_w, &pmap_h )) { int root_x = 0, root_y = 0; @@ -882,7 +882,7 @@ rxvt_term::check_our_parents_cb (time_watcher &w) shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF; tint = shading2tint32( &shade ); gc = XCreateGC (dpy, vt, 0UL, &gcvalue); - if (GetWinPosition (parent[0], &root_x, &root_y) ) + if (get_dpy_window_position(dpy, display->root, parent[0], NULL, NULL, &root_x, &root_y)) { ASImageLayer *layers = create_image_layers( 2 ); ASImage *merged_im = NULL; @@ -903,7 +903,7 @@ rxvt_term::check_our_parents_cb (time_watcher &w) MAKE_ROOTPMAP_GEOM(x,w,width); MAKE_ROOTPMAP_GEOM(y,h,height); - layers[0].im = AFTERIMAGE_DPY_OP (pixmap2asimage (asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100)); + layers[0].im = pixmap2asimage (asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100); layers[0].clip_x = (back_w == pmap_w)?root_x:0; layers[0].clip_y = (back_h == pmap_h)?root_y:0; layers[0].clip_width = szHint.width; @@ -961,7 +961,7 @@ rxvt_term::check_our_parents_cb (time_watcher &w) destroy_asimage( &(layers[0].im) ); if (merged_im != NULL) { - tmp_pmap = AFTERIMAGE_DPY_OP (asimage2pixmap (asv, DefaultRootWindow(dpy), merged_im, gc, True)); + tmp_pmap = asimage2pixmap (asv, DefaultRootWindow(dpy), merged_im, gc, True); destroy_asimage( &merged_im ); } free( layers ); -- 2.34.1