Gtk2: Tweak ScrollWindowEx (used by SynEdit vertical scrolling), apparently gdk_window_move_region does not always invalidate the "scrolled-in" area. See issue #14297

git-svn-id: trunk@21148 -
This commit is contained in:
martin 2009-08-09 19:21:00 +00:00
parent a4fe85f3d5
commit 1dd3dbe142

View File

@ -626,18 +626,21 @@ begin
if WidgetInfo <> nil then begin
if (dy < 0) and (WidgetInfo^.UpdateRect.Bottom > 0) then begin
Rect1.Height := Min(Rect1.height, WidgetInfo^.UpdateRect.Top);
Rect2 := Rect(0, Rect1.height, Rect1.width, Widget^.Allocation.Height);
InvalidateRect(hWnd, @Rect2, false);
Rect2 := Rect(0, Rect1.height + dy, Rect1.width, Widget^.Allocation.Height);
end;
if dy > 0 then begin
Rect1.y := Max(Rect1.y, WidgetInfo^.UpdateRect.Bottom);
Rect2 := Rect(0, 0, Rect1.width, Rect1.y);
InvalidateRect(hWnd, @Rect2, false);
Rect2 := Rect(0, 0, Rect1.width, Rect1.y + dy);
end;
end;
Region := gdk_region_rectangle(@Rect1);
gdk_window_move_region(Window, Region, dx, dy);
// Rect2 includes the Area at the scroll-in side of Rect1
// gdk_window_move_region is supposed to have invalidated it, but some
// implementations seem not to do this. (bug 14297)
InvalidateRect(hWnd, @Rect2, false);
{$ELSE}
gdk_window_scroll(Window, dx, dy);
{$ENDIF}