forked from AuroraMiddleware/gtk
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:
parent
c0c3085128
commit
3d5cd6e055
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user