It is currently September 9th, 2024, 1:28 pm

[Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

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

[Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by Cariboudjan »

I'm fairly certain this was not a limitation in prior releases.

Can anyone else confirm? Latest August 8th version.

!SetWindowPosition is also a problem.
User avatar
Yincognito
Rainmeter Sage
Posts: 8052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by Yincognito »

Cariboudjan wrote: August 19th, 2024, 1:31 pm I'm fairly certain this was not a limitation in prior releases.

Can anyone else confirm? Latest August 8th version.

!SetWindowPosition is also a problem.
I'm currently polishing a music playing skin I wrote, so I use this 4.5.30.3783 Rainmeter version, but I don't see any obvious issues with !SetWindowPosition, neither from the same skin (the controlled one) or from another one (the controlling one) - but then I don't know exactly what to look for either...

[SkinsFolder]\Test\Test.ini (the controlling skin):

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

---Meters---

[Image]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255
LeftMouseUpAction=[!SetWindowPosition "(#SCREENAREAX#+#SCREENAREAWIDTH#-#CURRENTCONFIGX#)R" "(#CURRENTCONFIGY#)" "(#CURRENTCONFIGWIDTH#)R" "0" "Test2"]
RightMouseUpAction=[!SetWindowPosition "(#CURRENTCONFIGX#)" "(#CURRENTCONFIGY#)" "0" "0" "Test2"]
DynamicVariables=1
[SkinsFolder]\Test\Test2.ini (the controlled skin):

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

---Meters---

[String]
Meter=String
W=300
H=300
FontFace=Segoe UI
FontSize=11
FontColor=255,255,255,255
Text=SetAnchor test
SolidColor=0,0,0,255
AntiAlias=1
ClipString=1
MouseScrollUpAction=[!SetOption String W ([String:W]+20)][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetOption String W ([String:W]-20)][!UpdateMeter *][!Redraw]
DynamicVariables=1

[Click]
Meter=Shape
X=([String:XW]-[Click:W])
Y=0
Shape=Rectangle 0,0,40,40,0 | Fill Color 0,200,0 | StrokeWidth 0
LeftMouseUpAction=[!SetWindowPosition "(#SCREENAREAX#+#SCREENAREAWIDTH#-#CURRENTCONFIGX#)R" "(#CURRENTCONFIGY#)" "(#CURRENTCONFIGWIDTH#)R" "0"]
RightMouseUpAction=[!SetWindowPosition "(#CURRENTCONFIGX#)" "(#CURRENTCONFIGY#)" "0" "0"]
DynamicVariables=1
I used the sample code from Crest here, with the changes I advised on at the time, for the controlled skin. Didn't bother to change those mouse actions when I pasted them in the controlling skin (red square), so yeah, the controlled one (green square in black square) will align with the controlling one in one way or another (use scrolling on the controlled one to see how). Obviously, the controlled one can set its own position in a similar manner.

P.S. Just realized that by inactive you meant unloaded skins. Yes, the controlling skin indeed doesn't seem to set the anchor on the controlled skin when the latter is unloaded. Did that really happen in previous Rainmeter versions? And is that supposed to happen since the target / controlled skin is unloaded in the first place? :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16506
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by balala »

Cariboudjan wrote: August 19th, 2024, 1:31 pm I'm fairly certain this was not a limitation in prior releases.
Too vague explanation. What do you mean by "inactive skin"? I assume a not focused skin, right? But if you do, can't replicate the issue. I tried:
  • Setting the anchor of the current skin, using a !SetAnchor bang, delayed by a number of seconds (LeftMouseUpAction=[!Delay "5000"][!SetAnchor "100" "100"]). I unfocused the skin, clicking both, other skins and not-Rainmeter windows, in the delaying 5 seconds.
  • Setting the anchor of a skin, from another skin.
In both cases the setting worked. I can't identify a way to get it not executed. So some details would be nice, maybe an example skin / code as well.
Cariboudjan wrote: August 19th, 2024, 1:31 pm !SetWindowPosition is also a problem.
What is the issue with the !SetWindowPosition?
User avatar
Cariboudjan
Posts: 278
Joined: May 12th, 2019, 8:55 am

Re: [Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by Cariboudjan »

An unloaded skin.
User avatar
balala
Rainmeter Sage
Posts: 16506
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by balala »

Cariboudjan wrote: August 21st, 2024, 5:24 pm An unloaded skin.
What do you mean by this, because I can't realize?
User avatar
Yincognito
Rainmeter Sage
Posts: 8052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by Yincognito »

balala wrote: August 22nd, 2024, 1:18 pm What do you mean by this, because I can't realize?
A reply earlier, you asked what does he mean by an inactive skin. Now, Cariboudjan responded to your question, that he meant an unloaded skin.

So, you can test !SetAnchor and / or !SetWindowPosition on an unloaded skin, if you want. Me, I already did that for the latter, and it didn't work, most likely because being unloaded, such a skin does not exist as a window in order to send the bang to it, if by any chance that is done through window messages. The only thing such a bang can do in this situation, if some effect is really desired, would be to write the anchor or skin window position to the current Rainmeter.ini file. It's possible that Cariboudjan referred to this when expecting a result from these bangs - just guessing here. :)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16506
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] !SetAnchor bang doesnt work to set anchor of inactive skins

Post by balala »

Yincognito wrote: August 22nd, 2024, 2:24 pm A reply earlier, you asked what does he mean by an inactive skin. Now, Cariboudjan responded to your question, that he meant an unloaded skin.
Alright, makes sense this way, just couldn't get that he replied to an earlier question. Quoting would have been nice in such cases, to let us know which question have been answered. My guess, at least...
Yincognito wrote: August 22nd, 2024, 2:24 pm So, you can test !SetAnchor and / or !SetWindowPosition on an unloaded skin, if you want. Me, I already did that for the latter, and it didn't work, most likely because being unloaded, such a skin does not exist as a window in order to send the bang to it, if by any chance that is done through window messages. The only thing such a bang can do in this situation, if some effect is really desired, would be to write the anchor or skin window position to the current Rainmeter.ini file. It's possible that Cariboudjan referred to this when expecting a result from these bangs - just guessing here. :)
On an unloaded skin / config, it's absolutely normal to get an error message. No question about this.