It is currently March 29th, 2024, 11:29 am

[BUG] InputText

Report bugs with the Rainmeter application and suggest features.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

[BUG] InputText

Post by kyriakos876 »

I am creating a skin and I came across with a BUG, or I think it is, that won't allow me to type. I click the input box and I see the Cursor ready to type and after 0,5 seconds it goes back to the normal box (The one I have to click in order to type) If I click on it and very fast type any letter I can see it for a while before it goes back to being blank. The code for the text is pretty simple and worked normally yesterday when I was editing other stuff on the skin.

Code: Select all

[MeasureSearchInput]
Measure=Plugin
Plugin=InputText
X=22
Y=12
W=136
H=20
FontSize=11
AntiAlias=1
UpdateDivider=-1
Command1=[!WriteKeyValue Variables Find "$UserInput$"][!Refresh]
Disabled=1
The code works if the position of the skin is normal (Zpos=0) but if set to StayTopMost (Zpos=2), the BUG I mentioned above occurs. Also I have to manually change the position as it seems that the !Zpos won't work.

Code: Select all

Show=[!ActivateConfig "WeatherProject\Location" "SetLocation.ini"][!ZPos "0" "WeatherProject\Location" "SetLocation.ini"]

Code: Select all

Show=[!ActivateConfig "WeatherProject\Location" "SetLocation.ini"][!ZPos "2" "WeatherProject\Location" "SetLocation.ini"]
These 2 codes act the same. They both set the position of the skin to "2" (StayTopMost) and I have to manually change it by right clicking the skin >Settings>Position>Normal. So it's stuck at Zpos=2... (If you wonder why put the !Zpos 0 in the first place I did it to cure the BUG but it seems to be unchanged whether I put 2 or 1).The "Show" is being executed through another Config (Obviously)

I am new to rainmeter so I could be missing something obvious or encountering a BUG indeed but I didn't find anything similar to the forum/docs so I make this post. Thanks for your time.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] InputText

Post by jsmorley »

I suspect the "Stay Topmost" is changing the "focus" while the InputText field is open. The way InputText works is that it is an entirely separate Windows "control" object. It requires complete focus and control while it is accepting text input.

By default, if the control loses focus, if you click anywhere else, or if some other window"grabs" focus, the control will close and nothing will be done. If you want to change that, which I seldom recommend, you can set FocusDismiss=0 on the InputText plugin measure and it will stay open (and not allow any other action on that skin) until you either hit Enter to complete the transaction, or ESC to abort.

The "Stay Topmost" is causing this. What is happening is that when you click the meter firing the InputText measure, the input field is opened and given focus. however, the skin in a very short period of time (probably one skin update cycle) is reacting to the "Stay Topmost" attribute and popping to the top, OVER the input field, and thus causing it to lose focus. I'm not entirely sure that FocusDimisss=0 will help in this case, and I think this might even make Rainmeter unstable, as the "Stay Topmost" is going to get in a probably fatal fight with the windows "control".

I'd stay away from "Stay Topmost" in Rainmeter with InputText. I think it's almost always a bad idea. I think the conflict between them is going to be hard to avoid, and probably ugly.

While not a "bug" really, it is a fundamental design flaw in the way InputText was implemented. Not much we can do about it without throwing it away and starting over.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: [BUG] InputText

Post by kyriakos876 »

Yea that makes sense and explains the Rainmeter crashes while trying to type... would there be the same issue if I were to set its position as "Topmost" instead of "Stay Topmost" ? I also tried FocusDimisss=0 but I don't like limiting user's spontaneity in case of, say, emergency click something.

Also If you could explain the priority of focus on "Stay Topmost" and "Topmost", that would be great. Is the "InputText"on a "Stay Topmost" focus level, or a "Topmost", hence the meter overriding it on every update?

P.S.1: I did actually change it to set it on Topmost and it seems to be working but I'm asking in order to prevent any unwanted activity such us "fatal fights"
P.S.2: I had to manually change the position set from the Bang I used once because something else happened cause by the Input probably, that made the Rainmeter completely ignore my [!Zpos .... "0"] bang no matter if I wrote -2,-1,-0,1,2 nothing was working so I went to (AppData/Roaming/Rainmeter/Rainmeter.ini) and changed it from there to 0.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] InputText

Post by jsmorley »

kyriakos876 wrote:Yea that makes sense and explains the Rainmeter crashes while trying to type... would there be the same issue if I were to set its position as "Topmost" instead of "Stay Topmost" ? I also tried FocusDimisss=0 but I don't like limiting user's spontaneity in case of, say, emergency click something.

Also If you could explain the priority of focus on "Stay Topmost" and "Topmost", that would be great. Is the "InputText"on a "Stay Topmost" focus level, or a "Topmost", hence the meter overriding it on every update?

P.S.1: I did actually change it to set it on Topmost and it seems to be working but I'm asking in order to prevent any unwanted activity such us "fatal fights"
P.S.2: I had to manually change the position set from the Bang I used once because something else happened cause by the Input probably, that made the Rainmeter completely ignore my [!Zpos .... "0"] bang no matter if I wrote -2,-1,-0,1,2 nothing was working so I went to (AppData/Roaming/Rainmeter/Rainmeter.ini) and changed it from there to 0.
The only one that will give you problems is "Stay Topmost" or AlwaysOnTop=2. It's the "stay" part of it that bites InputText. Basically it makes the skin window fight to stay on top of everything else on every skin update.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: [BUG] InputText

Post by kyriakos876 »

Great. Everything seems to be running smoothly now. Thanks a lot for answering!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] InputText

Post by jsmorley »

Glad to help. I added a note about this issue to the documentation for InputText.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: [BUG] InputText

Post by kyriakos876 »

Awesome! I hope others benefit from it on the future :)
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: [BUG] InputText

Post by kyriakos876 »

I also wanted to know why can't I add a plugin while creating a .rmskin... I go to the folder containing the .dll but the add button remains disabled and I only see the location of the .dll there, but no add button available. It stays blurred as if I never chose a file. Any ideas? Am I doing something wrong?
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: [BUG] InputText

Post by fonpaolo »

What plugin are you trying to add to the rmskin package?
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: [BUG] InputText

Post by kyriakos876 »

I want to add the FrostedGlass one made by theAzack9 but it's not that. I tried with other plugins too. Even with the ones already in the rainmeter and the add button just won't get clickable nor before of after selecting the .dll´s path. Let me add I tried reinstalling rainmeter or even go on another pc and install it there for the first time ever. (Both pc's on recommended installation path)
Here is an image for what I'm saying: https://s30.postimg.org/brmtge04h/Untitled.png
(It reads FrostedGlass1.dll instead of FrostedGlass.dll because I tried editing the name to see if that works. Needless to say it didn't :P )
Last edited by kyriakos876 on February 5th, 2017, 8:44 pm, edited 3 times in total.