mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-04 10:00:34 +01:00
LCL-CustomDrawn-X11: Further optimized the invalidation by redrawing only after all events are finished
git-svn-id: trunk@36067 -
This commit is contained in:
parent
6cc1867b3f
commit
32b1b8d917
@ -166,6 +166,7 @@ var
|
||||
begin
|
||||
while (DoBreakRun = False) do
|
||||
begin
|
||||
if XPending(FDisplay) <= 0 then AppProcessInvalidates();
|
||||
AppWaitMessage();
|
||||
AppProcessMessage();
|
||||
|
||||
@ -289,7 +290,11 @@ begin
|
||||
while True do
|
||||
begin
|
||||
// There are no more X messages to process
|
||||
if XPending(FDisplay) <= 0 then Exit;
|
||||
if XPending(FDisplay) <= 0 then
|
||||
begin
|
||||
AppProcessInvalidates();
|
||||
Exit;
|
||||
end;
|
||||
AppProcessMessage();
|
||||
end;
|
||||
end;
|
||||
@ -395,8 +400,6 @@ begin
|
||||
else
|
||||
DebugLn('LCL-CustomDrawn-X11: Unhandled X11 event received: ', GetXEventName(XEvent._type));
|
||||
end;
|
||||
|
||||
AppProcessInvalidates();
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -466,6 +469,7 @@ var
|
||||
rfds: baseunix.TFDSet;
|
||||
xconnnum, selectresult: integer;
|
||||
IsFirstTimeout: Boolean;
|
||||
AnyTimerProcessed: Boolean = False;
|
||||
lTimer: TCDTimer;
|
||||
lTimeoutInterval: Integer; // miliseconds
|
||||
i: Integer;
|
||||
@ -512,10 +516,11 @@ begin
|
||||
if lTimer.NativeHandle >= lTimer.Interval then
|
||||
begin
|
||||
lTimer.TimerFunc();
|
||||
AppProcessInvalidates();
|
||||
AnyTimerProcessed := True;
|
||||
lTimer.NativeHandle := 0;
|
||||
end;
|
||||
end;
|
||||
if AnyTimerProcessed then AppProcessInvalidates();
|
||||
|
||||
if selectresult <> 0 then // We got a X event or the timeout happened
|
||||
Exit
|
||||
|
||||
@ -80,6 +80,7 @@ type
|
||||
FocusedControl: TWinControl; // The control focused in the form
|
||||
FocusedIntfControl: TWinControl; // The intf control focused in the form
|
||||
LayoutAutoAdjusted: Boolean; // Indicates if the form layout was already auto-adjusted once
|
||||
// For merging invalidate requests, currently utilized in X11
|
||||
InvalidateRequestedInAnyControl: Boolean;
|
||||
// painting objects which represent the composed form image, don't confuse with ControlImage/ControlCanvas
|
||||
Image: TLazIntfImage;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user