From 790e387825060bb85ab859c43f1fae18e5eede4f Mon Sep 17 00:00:00 2001 From: zeljan1 Date: Thu, 13 Feb 2025 09:03:23 +0100 Subject: [PATCH] Gtk3: do not invalidate whole area if rect is empty. --- lcl/interfaces/gtk3/gtk3widgets.pas | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lcl/interfaces/gtk3/gtk3widgets.pas b/lcl/interfaces/gtk3/gtk3widgets.pas index 9f6a296041..cc163e91fb 100644 --- a/lcl/interfaces/gtk3/gtk3widgets.pas +++ b/lcl/interfaces/gtk3/gtk3widgets.pas @@ -3455,13 +3455,16 @@ procedure TGtk3Widget.Update(ARect: PRect); begin if IsWidgetOK then begin - if (ARect <> nil) and (aRect^.Width > 0) and (ARect^.Height > 0) then + if (ARect <> nil) then begin - with ARect^ do - FWidget^.queue_draw_area(Left, Top, Right - Left, Bottom - Top); - if FWidget <> GetContainerWidget then + if (aRect^.Width > 0) and (ARect^.Height > 0) then + begin with ARect^ do - GetContainerWidget^.queue_draw_area(Left, Top, Right - Left, Bottom - Top); + FWidget^.queue_draw_area(Left, Top, Right - Left, Bottom - Top); + if FWidget <> GetContainerWidget then + with ARect^ do + GetContainerWidget^.queue_draw_area(Left, Top, Right - Left, Bottom - Top); + end; end else begin //FWidget^.queue_draw;