It is currently November 26th, 2022, 7:07 pm

Here's a cute bug for you.

Report bugs with the Rainmeter application and suggest features.
User avatar
RetardedRaven
Posts: 16
Joined: July 8th, 2009, 10:42 pm

Here's a cute bug for you.

Post by RetardedRaven »

Alright so this is not a simple bug to replicate and if you want I can give you my skin to demonstrate.

Ok my skin first off has a webparser that acts as a fileparser and regexes the rainmeter.ini and then gets the skins position in x and y. (i set updaterate=1 so it's the most relevant position) And this all works dandy. Why this is done is that when you click the button it takes the measure of it's own position and activates and moves another skin to the same location (so no matter where i move skin a when i click skin a's button skin b shows up just below it) This too works fine.

Except for this.
When you first add the skin and click the button it activates the other skin and moves EVERY SKIN to the top left corner (including skins not my own).

However if you add the skin and refresh all once this never happens.

Now I tried adding in !RainmeterRefresh instead of redraw but that does nothing you have to manually do a refresh all once you add the skin. once it's been added though and refreshed all once this will never occur.

While this does seem like an easy fix to my personal use (just refresh all once) it does make a bit of an issue if i were to release my skin and worse if people were to customize it and release similar working skins. Namely we'd have to have explicit instructions to refresh all after placing a skin. Also i would have to get a lot of people sending me emails/posting forums asking why does it move everything to the top left.

If any of you can figure out why this is happening or have a workaround i can implement that would be great.

Below is a sample of the regex calling for x/y pos and the command i use to move.

Code: Select all

[MeasurePosition]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://#SETTINGSPATH#\Rainmeter.ini
RegExp="(?siU)\[Alchymist.*Skins.*Network.*WiFi].*WindowX=(.*)\nWindowY.*=(.*)Alpha"
UpdateRate=1

[MeasureX]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasurePosition]
StringIndex=1

[MeasureY]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasurePosition]
StringIndex=2

Code: Select all

[MeterWiFi]
Meter=Image
MeterStyle=StyleElementBack
LeftMouseDownAction=!execute [!RainmeterHideMeter MeterWiFi][!RainmeterShowMeter MeterWiFiActive][!RainmeterRedraw]

[MeterWiFiActive]
Meter=Image
MeterStyle=StyleElementBack
Hidden=1
LeftMouseUpAction=!execute [!RainmeterToggleConfig "Alchymist\Engine\Transmutation\WiFi" "WiFi.ini"][!RainmeterMove [MeasureX] [MeasureY] "Alchymist\Engine\Transmutation\WiFi"][!RainmeterHideMeter MeterWiFiActive][!RainmeterShowMeter MeterWiFi][!RainmeterRedraw] <- Changing this to Refresh does nothing
User avatar
spx
Developer
Posts: 686
Joined: August 15th, 2009, 2:41 pm
Location: Osaka, JPN

Re: Here's a cute bug for you.

Post by spx »

It's because WindowX/Y doesn't exist at the first time. WebParser is failed.

Code: Select all

DEBUG: (00:00:07.016) WebParser: Fetching URL: file://D:\Rainmeter\\Rainmeter.ini
DEBUG: (00:00:07.016) WebParser: Finished URL: file://D:\Rainmeter\\Rainmeter.ini
DEBUG: (00:00:07.016) WebParser: Matching error! (-1)
So,

Code: Select all

[!RainmeterMove [MeasureX] [MeasureY] "Alchymist\Engine\Transmutation\WiFi"]
is replaced to

Code: Select all

[!RainmeterMove   "Alchymist\Engine\Transmutation\WiFi"]
([MeasureX] and [MeasureY] is replaced to empty string.)

At this time, the part where the number of the arguments are checked is incomplete, so this bang is sent to all skin windows.

For workaround, please define WindowX/Y beforehand, or add ErrorString="0" to [MeasureX] and [MeasureY].

Code: Select all

[MeasureX]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasurePosition]
StringIndex=1
ErrorString="0"

[MeasureY]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasurePosition]
StringIndex=2
ErrorString="0"
User avatar
RetardedRaven
Posts: 16
Joined: July 8th, 2009, 10:42 pm

Re: Here's a cute bug for you.

Post by RetardedRaven »

Alright then spx. I still don't get why the incomplete command sends to all skins or how your fix works exactly but it fixes everything.

Adding ErrorString="0" to the measure made me think oh ok it will just send it to 0,0 the first time rather than moving all skins. However it sends to the correct location the first time the skin is loaded (before refreshing) Like I said I'm not sure how that works either but it does perfectly.

Thanks a lot spx. This fix works better than I thought it would.