Skip to content

Commit

Permalink
Patch to fix high CPU usage from stefonarch
Browse files Browse the repository at this point in the history
  • Loading branch information
niknah committed Sep 29, 2023
1 parent b307a3d commit 6c16416
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin-customcommand/lxqtcustomcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 6c16416

Please sign in to comment.