quartz: fix corruption during scrolling in some cases

A call to scrollRect must be followed by a call to set that the offset
rect needs display for the changes to "take effect". This was not
done prior to this patch which, in some cases, caused corruption during
scrolling.
This commit is contained in:
Kristian Rietveld 2012-08-26 15:45:46 +02:00
parent c0c3085128
commit 3d5cd6e055

View File

@ -359,10 +359,17 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable,
*/
if (drawable == (GdkDrawable *)window_impl)
{
[window_impl->view scrollRect:NSMakeRect (xsrc, ysrc, width, height)
by:NSMakeSize (xdest - xsrc, ydest - ysrc)];
NSRect rect = NSMakeRect (xsrc, ysrc, width, height);
NSSize offset = NSMakeSize (xdest - xsrc, ydest - ysrc);
[window_impl->view scrollRect:rect by:offset];
/* The scrollRect only "takes effect" on the next redraw, we must
* set that the offset rectangle needs display.
*/
rect.origin.x += offset.width;
rect.origin.y += offset.height;
[window_impl->view setNeedsDisplayInRect:rect];
}
else
g_warning ("Drawing with window source != dest is not supported");