It is currently March 29th, 2024, 2:17 pm

[Bug?] Rainmeter CPU spikes when mouse is moved when a ScrollUp/Down action is used in any skin

Report bugs with the Rainmeter application and suggest features.
User avatar
Cariboudjan
Posts: 264
Joined: May 12th, 2019, 8:55 am

[Bug?] Rainmeter CPU spikes when mouse is moved when a ScrollUp/Down action is used in any skin

Post by Cariboudjan »

If any single Rainmeter skin has a MouseScrollUpAction= in any section of a skin, focusing on that skin after Rainmeter is opened will PERMANENTLY cause CPU usage spikes when the mouse cursor is moved for the remainder of that skin/Rainmeter being open, regardless of what application or skin is focued/opened/otherwise.

Removing ScrollUp/Down actions from all running skins and re-launching Rainmeter will cause the CPU use spikes to stop when the mouse is moved.

Rainmeter spikes between 1-3% on mouse move on my laptop.

Try:

1. Create a skin using the below code
2. Close all skins except that 1 skin.
3. Exit Rainmeter, Open Rainmeter
4. Click on the skin
5. Move the cursor while observing Rainmeter CPU usage in Task Manager

No CPU usage should be reported.

Code: Select all

[Rainmeter]

[Variables]

[Meter]
Meter=Image
SolidColor=255,55,55
W=50
H=50
1. Add the below to the skin's code. Save.
2. Exit Rainmeter, Open Rainmeter.
3. Click on the skin.
4. Move the cursor while observing Rainmeter CPU usage in Task Manager

CPU usage should now be spiking when the mouse is moved. Rainmeter will continue to spike when the mouse is moved regardless of what app is focused, regardless of what the skin Z position is, regardless of any other factor, CPU usage will continue to spike on mouse move for the duration that Rainmeter or that skin is open.

Note: For some unknown reason, the CPU will not spike on mouse move when the Task Manager has focus. Maybe this is helpful. Not sure why it would be an exception to the rule. But ScrollUp/Down actions do not work in Rainmeter while the Task Manager has focus.

Code: Select all

[Rainmeter]
MouseScrollUpAction=[!Redraw]
MouseScrollDownAction=[!Redraw]

Rainmeter 4.4.0.3438 beta (64-bit)
Language: English (1033)
Build time: 2021-03-13 11:47:49
Windows 10 Pro 2004 64-bit (build 19041) - English (1033)
Path: C:\Program Files\Rainmeter\
SkinPath: C:\Users\Carib\Documents\Rainmeter\Skins\
SettingsPath: C:\Users\Carib\AppData\Roaming\Rainmeter\
IniFile: C:\Users\Carib\AppData\Roaming\Rainmeter\Rainmeter.ini
Last edited by Cariboudjan on June 15th, 2021, 6:58 pm, edited 11 times in total.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: [Bug?] Rainmeter CPU spikes when mouse is moved when a ScrollUp/Down action is used in any skin

Post by SilverAzide »

Cariboudjan wrote: June 14th, 2021, 12:17 am
So I tried all this... and, yep, I get the same behavior. When you say "permanently" causes spikes, the spikes do settle down once you stop moving the mouse, but otherwise they do keep happening once you've done the steps you describe.

I have about 11-12 skins loaded with Rainmeter using about 1.5-2.5% CPU when the system is quiescent. Only one skin of the bunch has a scrollup/down action, and if it is loaded and I follow your steps, I can spike the CPU about 3% higher by moving the mouse around like crazy. If I unload that one skin, moving the mouse has virtually no effect on Rainmeter's CPU usage. Interesting...
Gadgets Wiki GitHub More Gadgets...
User avatar
Cariboudjan
Posts: 264
Joined: May 12th, 2019, 8:55 am

Re: [Bug?] Rainmeter CPU spikes when mouse is moved when a ScrollUp/Down action is used in any skin

Post by Cariboudjan »

Temporary solution, add:

To MouseLeaveAction= of meters that use MouseScrollUp/DownAction:

Code: Select all

[!DisableMouseActionGroup "MouseScrollUpAction|MouseScrollDownAction" "ScrollGroup"]
To OnRefreshAction= of any skin that is always open:

Code: Select all

[!DisableMouseActionGroup "MouseScrollUpAction|MouseScrollDownAction" "ScrollGroup"]
To MouseOverAction= of meters that use MouseScrollUp/DownAction:

Code: Select all

[!EnableMouseActionGroup "MouseScrollUpAction|MouseScrollDownAction" "ScrollGroup"]
To all meters that use MouseScrollUp/DownAction:

Code: Select all

Group=ScrollGroup
User avatar
Yincognito
Rainmeter Sage
Posts: 7030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug?] Rainmeter CPU spikes when mouse is moved when a ScrollUp/Down action is used in any skin

Post by Yincognito »

Cariboudjan wrote: June 14th, 2021, 12:17 am If any single Rainmeter skin has a MouseScrollUpAction= in any section of a skin, focusing on that skin after Rainmeter is opened will PERMANENTLY cause CPU usage spikes when the mouse cursor is moved for the remainder of that skin/Rainmeter being open, regardless of what application or skin is focued/opened/otherwise.

Removing ScrollUp/Down actions from all running skins and re-launching Rainmeter will cause the CPU use spikes to stop when the mouse is moved.
I (and the user deflore08) can confirm this behavior too, not because of testing your code, but because we both noticed it when dealing with his skin, which has all kinds of ActionTimers and MouseOverActions. In fact we noticed it not on scrolling, but also on MouseOver actions - where the CPU spike is present even if the mouse is NOT on the MouseOver meter and no other CPU intensive action takes place. Unfortunately, my skins are too tiny to have a more comprehensive opinion on this or do more tests and deflore08 is not around at the moment to share his experience, but I would be interested to see how this thread develops.

Apart from that, I guess some CPU usage is natural as Rainmeter probably checks in its own way (which could be more or less reliant on the "standard" Windows mouse event captures, in the sense of including more than just that) whether a mouse event affects a particular meter in a particular skin. Maybe some optimization of that process, if required, would help in minimize or even eliminate the issue.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Cariboudjan
Posts: 264
Joined: May 12th, 2019, 8:55 am

Re: [Bug?] Rainmeter CPU spikes when mouse is moved when a ScrollUp/Down action is used in any skin

Post by Cariboudjan »

Scratch my "temporary solution"... This is more difficult to squash than I thought. The problem just keeps popping back for no apparent reason.