Test skin:
Code: Select all
[Variables]
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Measures---
[MeasureTest]
Measure=Calc
UpdateDivider=-1
;OnUpdateAction=[!WriteKeyValue "#CURRENTCONFIG#" AnchorX "" "#SETTINGSPATH#Rainmeter.ini"][!WriteKeyValue "#CURRENTCONFIG#" AnchorY "" "#SETTINGSPATH#Rainmeter.ini"][!WriteKeyValue "#CURRENTCONFIG#" WindowX (#WORKAREAX#+#WORKAREAWIDTH#/2-#CURRENTCONFIGWIDTH#/2) "#SETTINGSPATH#Rainmeter.ini"][!WriteKeyValue "#CURRENTCONFIG#" WindowY (#WORKAREAY#+#WORKAREAHEIGHT#/2-#CURRENTCONFIGHEIGHT#/2) "#SETTINGSPATH#Rainmeter.ini"][!UpdateMeter *][!Redraw]
;OnUpdateAction=[!WriteKeyValue "#CURRENTCONFIG#" AnchorX "50%" "#SETTINGSPATH#Rainmeter.ini"][!WriteKeyValue "#CURRENTCONFIG#" AnchorY "50%" "#SETTINGSPATH#Rainmeter.ini"][!WriteKeyValue "#CURRENTCONFIG#" WindowX "50%" "#SETTINGSPATH#Rainmeter.ini"][!WriteKeyValue "#CURRENTCONFIG#" WindowY "50%" "#SETTINGSPATH#Rainmeter.ini"][!UpdateMeter *][!Redraw]
DynamicVariables=1
---Meters---
[MeterTest]
Meter=STRING
X=0
Y=0
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
UpdateDivider=-1
Text="Skin's X,Y = #CURRENTCONFIGX#, #CURRENTCONFIGY#"
DynamicVariables=1
1) according to the manual, "setting WindowX, WindowY, AnchorX and AnchorY all to 50% the config will be truly centered in the primary monitor regardless of screen resolution or aspect ratio". Do just that for the above skin, by editing your Rainmeter.ini, or uncomment the corresponding OnUpdateAction above to let the skin do it for you
2) now, with the skin above unloaded, try to load it
3) after checking the result, refresh the skin and check the result again
The issue:
On loading the above centered skin, the #CURRENTCONFIGX# and #CURRENTCONFIGY# displayed are actually the AnchorX and AnchorY, and not the WindowX and WindowY, as it should be the case. On subsequent skin refresh(ing), the displayed #CURRENTCONFIGX# and #CURRENTCONFIGY# become the correct ones, e.g. CURRENTCONFIGX = WindowX = AnchorX - (SkinWidth / 2) and such (compared to the incorrect CURRENTCONFIGX = AnchorX = ((WorkAreaWidth - WorkAreaX) / 2) at skin load). <= replaced this with the right explanation below, see the EDIT here.
On loading the above centered skin, the #CURRENTCONFIGX# and #CURRENTCONFIGY# displayed are actually the WindowX and WindowY, and not the WindowX-AnchorX and WindowY-AnchorY, as it should be the case. On subsequent skin refresh(ing), the displayed #CURRENTCONFIGX# and #CURRENTCONFIGY# become the correct ones, e.g. CURRENTCONFIGX = WindowX - AnchorX = (#SCREENAREAWIDTH# - #SCREENAREAX#) / 2 - #CURRENTCONFIGWIDTH# / 2 and such (compared to the incorrect CURRENTCONFIGX = WindowX = (#SCREENAREAWIDTH# - #SCREENAREAX#) / 2 at skin load).
Even easier to follow: my monitor is 1366 x 768. For a skin having those 4 values above (WindowX/Y and AnchorX/Y) set to 50% in Rainmeter.ini:
- the #CURRENTCONFIGX# and #CURRENTCONFIGY# reported on load are (incorrectly) 683 and 384, respectively (i.e. screen center coordinates)
- on skin refresh, the two variables above (correctly) subtract half of the skin's width and height from 683 and 384, displaying the accurate coordinates
The question:
Why does this happen and how to correct it, if possible? And if not possible, is this a bug or something else?