From 1dd3dbe142e23117efb9562f92a647acbee155bb Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 9 Aug 2009 19:21:00 +0000 Subject: [PATCH] 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 - --- lcl/interfaces/gtk2/gtk2winapi.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2winapi.inc b/lcl/interfaces/gtk2/gtk2winapi.inc index 4477523cfb..74d3a5074c 100644 --- a/lcl/interfaces/gtk2/gtk2winapi.inc +++ b/lcl/interfaces/gtk2/gtk2winapi.inc @@ -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}