diff --git a/src/compositor.c b/src/compositor.c index 165601f301f74753a3180f4ea82cc5777693a203..122467b83b05a0bf0abe24fe13533367fa68dbee 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1919,7 +1919,7 @@ unredirect_win (CWindow *cw) } static void -paint_root (ScreenInfo *screen_info, gushort buffer) +paint_root (ScreenInfo *screen_info, Picture paint_buffer) { g_return_if_fail (screen_info != NULL); TRACE ("entering"); @@ -1933,21 +1933,21 @@ paint_root (ScreenInfo *screen_info, gushort buffer) XRenderComposite (myScreenGetXDisplay (screen_info), PictOpSrc, screen_info->rootTile, - None, screen_info->rootBuffer[buffer], + None, paint_buffer, 0, 0, 0, 0, 0, 0, screen_info->width, screen_info->height); } static void -paint_cursor (ScreenInfo *screen_info, XserverRegion region, gushort buffer) +paint_cursor (ScreenInfo *screen_info, XserverRegion region, Picture paint_buffer) { XFixesSetPictureClipRegion (myScreenGetXDisplay (screen_info), - screen_info->rootBuffer[buffer], 0, 0, region); + paint_buffer, 0, 0, region); XRenderComposite (myScreenGetXDisplay (screen_info), PictOpOver, screen_info->cursorPicture, - None, screen_info->rootBuffer[buffer], + None, paint_buffer, 0, 0, 0, 0, screen_info->cursorLocation.x, screen_info->cursorLocation.y, @@ -1956,7 +1956,7 @@ paint_cursor (ScreenInfo *screen_info, XserverRegion region, gushort buffer) } static void -paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_part) +paint_win (CWindow *cw, XserverRegion region, Picture paint_buffer, gboolean solid_part) { ScreenInfo *screen_info; DisplayInfo *display_info; @@ -2002,7 +2002,7 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par /* Top Border (title bar) */ XRenderComposite (display_info->dpy, PictOpOver, cw->picture, cw->alphaBorderPict, - screen_info->rootBuffer[buffer], + paint_buffer, 0, 0, 0, 0, frame_x, frame_y, @@ -2010,14 +2010,14 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par /* Bottom Border */ XRenderComposite (display_info->dpy, PictOpOver, cw->picture, cw->alphaBorderPict, - screen_info->rootBuffer[buffer], + paint_buffer, 0, frame_height - frame_bottom, 0, 0, frame_x, frame_y + frame_height - frame_bottom, frame_width, frame_bottom); /* Left Border */ XRenderComposite (display_info->dpy, PictOpOver, cw->picture, cw->alphaBorderPict, - screen_info->rootBuffer[buffer], + paint_buffer, 0, frame_top, 0, 0, frame_x, frame_y + frame_top, @@ -2025,7 +2025,7 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par /* Right Border */ XRenderComposite (display_info->dpy, PictOpOver, cw->picture, cw->alphaBorderPict, - screen_info->rootBuffer[buffer], + paint_buffer, frame_width - frame_right, frame_top, 0, 0, frame_x + frame_width - frame_right, @@ -2038,16 +2038,13 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par XRectangle r; XserverRegion client_region; - XFixesSetPictureClipRegion (display_info->dpy, - screen_info->rootBuffer[buffer], - 0, 0, region); + XFixesSetPictureClipRegion (display_info->dpy, paint_buffer, 0, 0, region); XRenderComposite (display_info->dpy, PictOpSrc, cw->picture, None, - screen_info->rootBuffer[buffer], + paint_buffer, frame_left, frame_top, 0, 0, frame_x + frame_left, frame_y + frame_top, - frame_width - frame_left - frame_right, - frame_height - frame_top - frame_bottom); + frame_width - frame_left - frame_right, frame_height - frame_top - frame_bottom); r.x = frame_x + frame_left; r.y = frame_y + frame_top; @@ -2060,12 +2057,11 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par else if (!solid_part) { XRenderComposite (display_info->dpy, PictOpOver, cw->picture, cw->alphaPict, - screen_info->rootBuffer[buffer], + paint_buffer, frame_left, frame_top, 0, 0, frame_x + frame_left, frame_y + frame_top, - frame_width - frame_left - frame_right, - frame_height - frame_top - frame_bottom); + frame_width - frame_left - frame_right, frame_height - frame_top - frame_bottom); } } else @@ -2076,12 +2072,10 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par get_paint_bounds (cw, &x, &y, &w, &h); if (paint_solid) { - XFixesSetPictureClipRegion (display_info->dpy, - screen_info->rootBuffer[buffer], - 0, 0, region); + XFixesSetPictureClipRegion (display_info->dpy, paint_buffer, 0, 0, region); XRenderComposite (display_info->dpy, PictOpSrc, cw->picture, None, - screen_info->rootBuffer[buffer], + paint_buffer, 0, 0, 0, 0, x, y, w, h); XFixesSubtractRegion (display_info->dpy, region, region, cw->borderSize); } @@ -2089,7 +2083,7 @@ paint_win (CWindow *cw, XserverRegion region, gushort buffer, gboolean solid_par { XRenderComposite (display_info->dpy, PictOpOver, cw->picture, cw->alphaPict, - screen_info->rootBuffer[buffer], + paint_buffer, 0, 0, 0, 0, x, y, w, h); } } @@ -2113,6 +2107,7 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) { DisplayInfo *display_info; XserverRegion paint_region; + Picture paint_buffer; Display *dpy; GList *list; gint screen_width; @@ -2158,8 +2153,12 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) screen_info->zoomBuffer = create_root_buffer (screen_info, pixmap); XFreePixmap (display_info->dpy, pixmap); } + paint_buffer = screen_info->zoomBuffer; + } + else + { + paint_buffer = screen_info->rootBuffer[buffer]; } - /* Copy the original given region */ paint_region = XFixesCreateRegion (dpy, NULL, 0); XFixesCopyRegion (dpy, paint_region, region); @@ -2212,7 +2211,7 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) } if (WIN_IS_OPAQUE(cw)) { - paint_win (cw, paint_region, buffer, TRUE); + paint_win (cw, paint_region, paint_buffer, TRUE); } if (cw->borderClip == None) { @@ -2227,10 +2226,10 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) * region has changed because of the XFixesSubtractRegion (), * reapply clipping for the last iteration. */ - XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer[buffer], 0, 0, paint_region); + XFixesSetPictureClipRegion (dpy, paint_buffer, 0, 0, paint_region); if (!is_region_empty (dpy, paint_region)) { - paint_root (screen_info, buffer); + paint_root (screen_info, paint_buffer); } /* @@ -2255,9 +2254,9 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) shadowClip = XFixesCreateRegion (dpy, NULL, 0); XFixesSubtractRegion (dpy, shadowClip, cw->borderClip, cw->borderSize); - XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer[buffer], 0, 0, shadowClip); + XFixesSetPictureClipRegion (dpy, paint_buffer, 0, 0, shadowClip); XRenderComposite (dpy, PictOpOver, screen_info->blackPicture, cw->shadow, - screen_info->rootBuffer[buffer], 0, 0, 0, 0, + paint_buffer, 0, 0, 0, 0, cw->attr.x + cw->shadow_dx, cw->attr.y + cw->shadow_dy, cw->shadow_width, cw->shadow_height); @@ -2274,8 +2273,8 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) 0.0 /* blue */); } XFixesIntersectRegion (dpy, cw->borderClip, cw->borderClip, cw->borderSize); - XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer[buffer], 0, 0, cw->borderClip); - paint_win (cw, paint_region, buffer, FALSE); + XFixesSetPictureClipRegion (dpy, paint_buffer, 0, 0, cw->borderClip); + paint_win (cw, paint_region, paint_buffer, FALSE); } if (shadowClip) @@ -2296,7 +2295,7 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) { if (screen_info->zoomed) { - paint_cursor (screen_info, region, buffer); + paint_cursor (screen_info, region, paint_buffer); } fence_reset (screen_info, buffer); } @@ -2305,11 +2304,11 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) { if (screen_info->zoomed) { - paint_cursor (screen_info, region, buffer); + paint_cursor (screen_info, region, paint_buffer); /* Fixme: copy back whole screen if zoomed It would be better to scale the clipping region if possible. */ XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer[buffer], 0, 0, None); - XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer[buffer], 0, 0, None); + XFixesSetPictureClipRegion (dpy, paint_buffer, 0, 0, None); } else { @@ -2350,7 +2349,7 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) } else { - XRenderComposite (dpy, PictOpSrc, screen_info->rootBuffer[buffer], + XRenderComposite (dpy, PictOpSrc, paint_buffer, None, screen_info->rootPicture, 0, 0, 0, 0, 0, 0, screen_width, screen_height); }