From e8348c050d8696e69aa428aeb3611d15c6fc1570 Mon Sep 17 00:00:00 2001 From: zeljan1 Date: Fri, 18 Nov 2022 15:38:38 +0100 Subject: [PATCH] Qt5: reduce CPU usage with native event loop on mswindows --- lcl/interfaces/qt5/qtobject.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/qt5/qtobject.inc b/lcl/interfaces/qt5/qtobject.inc index 8d04e2ad68..ed7aff8691 100644 --- a/lcl/interfaces/qt5/qtobject.inc +++ b/lcl/interfaces/qt5/qtobject.inc @@ -287,7 +287,7 @@ begin else QTimer_setInterval(ATimer, 0); {$ELSE} - QTimer_setInterval(ATimer, {$IFDEF QtCocoa}5{$ELSE}0{$ENDIF}); + QTimer_setInterval(ATimer, {$IFDEF QtCocoa}5{$ELSE}1{$ENDIF}); {$ENDIF} QTimer_start(ATimer); FMainTimerID := QTimer_timerId(ATimer); @@ -314,7 +314,7 @@ begin {we cannot call directly processEvents() with this flag since it produces AV's sometimes, so better check is there any pending event.} - {$IF DEFINED(QtUseNativeEventLoop) AND DEFINED(QtCocoa)} + {$IF DEFINED(QtUseNativeEventLoop) AND NOT DEFINED(HASX11)} if not QCoreApplication_hasPendingEvents() then {$ENDIF} QCoreApplication_processEvents(QEventLoopWaitForMoreEvents);