From 6c164168b8497e3ab8a03888c581ff33373a61a4 Mon Sep 17 00:00:00 2001 From: niknah Date: Fri, 29 Sep 2023 20:57:15 +1000 Subject: [PATCH] Patch to fix high CPU usage from stefonarch --- plugin-customcommand/lxqtcustomcommand.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin-customcommand/lxqtcustomcommand.cpp b/plugin-customcommand/lxqtcustomcommand.cpp index 78e19686f..e89e3dc75 100644 --- a/plugin-customcommand/lxqtcustomcommand.cpp +++ b/plugin-customcommand/lxqtcustomcommand.cpp @@ -46,7 +46,7 @@ LXQtCustomCommand::LXQtCustomCommand(const ILXQtPanelPluginStartupInfo &startupI mRunWithBash(true), mOutputImage(false), mRepeat(true), - mRepeatTimer(1), + mRepeatTimer(5), mMaxWidth(200) { mButton = new CustomButton(this); @@ -140,7 +140,7 @@ void LXQtCustomCommand::settingsChanged() if (oldCommand != mCommand || oldRunWithBash != mRunWithBash || oldOutputImage != mOutputImage || oldRepeat != mRepeat) shouldRun = true; - if (oldRepeatTimer != mRepeatTimer) + if (mFirstRun || oldRepeatTimer != mRepeatTimer) mTimer->setInterval(mRepeatTimer * 1000); if (oldIcon != mIcon) { @@ -150,10 +150,10 @@ void LXQtCustomCommand::settingsChanged() else if (oldText != mText) updateButton(); - if (oldMaxWidth != mMaxWidth) + if (mFirstRun || oldMaxWidth != mMaxWidth) mButton->setMaxWidth(mMaxWidth); - if (oldAutoRotate != mAutoRotate) + if (mFirstRun || oldAutoRotate != mAutoRotate) mButton->setAutoRotation(mAutoRotate); if (mFirstRun) {