It is currently April 24th, 2024, 2:17 pm

Using Rainmeter to switch Wallpaper Engine causes crashes

Get help with creating, editing & fixing problems with skins
Ponyboy
Posts: 1
Joined: August 5th, 2020, 3:35 pm

Using Rainmeter to switch Wallpaper Engine causes crashes

Post by Ponyboy »

So I'm really amateur when it comes to programming but I've been tweaking a dock script to add in some functionality. I have made it so that when I mouse over a game in the dock it switches my Wallpaper Engine wallpaper to one specific to that game. It does this by using Wallpaper Engines command line controls and running commands with the RunCommand plugin to switch Wallpaper.

It goes a little something like this:

Code: Select all

[Command]
Measure=Plugin
Plugin=RunCommand
StartInFolder=C:\Program Files (x86)\Steam\steamapps\common\wallpaper_engine
Parameter=wallpaper32.exe -control openWallpaper -file "C:\Program Files (x86)\Steam\steamapps\workshop\content\431960\2031538957\project.json"

[Icon]
Meter=Image
ImageName=#@#App\icon.png
MouseOverAction=[!CommandMeasure Command Run]
It works fine for switching it over but the problem comes when I move my mouse too quickly over too many icons and it causes Wallpaper Engine to crash because it is trying to switch to too many things too fast. I'm just wondering if there is any way to optimize this script so that it only switches after a rest period. I've tried using !Delay to try to give it some time but I still get crashes with a 1 second delay. I'm sorry if I'm asking too much here and feel free to tell me to take it up with Wallpaper Engine to try to fix this. Thank you! :D
User avatar
Yincognito
Rainmeter Sage
Posts: 7154
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using Rainmeter to switch Wallpaper Engine causes crashes

Post by Yincognito »

Ponyboy wrote: August 5th, 2020, 4:00 pm So I'm really amateur when it comes to programming but I've been tweaking a dock script to add in some functionality. I have made it so that when I mouse over a game in the dock it switches my Wallpaper Engine wallpaper to one specific to that game. It does this by using Wallpaper Engines command line controls and running commands with the RunCommand plugin to switch Wallpaper.

It goes a little something like this:

Code: Select all

[Command]
Measure=Plugin
Plugin=RunCommand
StartInFolder=C:\Program Files (x86)\Steam\steamapps\common\wallpaper_engine
Parameter=wallpaper32.exe -control openWallpaper -file "C:\Program Files (x86)\Steam\steamapps\workshop\content\431960\2031538957\project.json"

[Icon]
Meter=Image
ImageName=#@#App\icon.png
MouseOverAction=[!CommandMeasure Command Run]
It works fine for switching it over but the problem comes when I move my mouse too quickly over too many icons and it causes Wallpaper Engine to crash because it is trying to switch to too many things too fast. I'm just wondering if there is any way to optimize this script so that it only switches after a rest period. I've tried using !Delay to try to give it some time but I still get crashes with a 1 second delay. I'm sorry if I'm asking too much here and feel free to tell me to take it up with Wallpaper Engine to try to fix this. Thank you! :D
What I would do is trigger the RunCommand execution through another "counter" measure (basically just a Calc measure) that would get disabled / enabled on mouse leave / over. The counter measure would start disabled and simply count the number of updates that passed since the measure has been enabled (i.e. since the mouse is over the meter), then in an IfCondition added to the counter measure I would check if the desired number of updates has passed (i.e. if the measure value is greater than the desired number) and only then command the RunCommand measure to run.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth