It is currently September 21st, 2024, 5:33 am

Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Get help with installing and using Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 16568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by balala »

jsmorley wrote: August 26th, 2024, 6:47 pm I think if you do this to load a "layout", you will find yourself in the endless loop I described above.
I have a Launcher skin, which can be used to launch and close Notepad. In the Game mode tab of Manage Rainmeter I clicked Additional process list and added Notepad.exe. On the On start button of the Game mode tab, I set up a layout called Empty (which contains only the Launcher skin). On the On close button I set up a layout containing a lot of skins.
Now whenever I launch Notepad from the Launcher skin (or other way), the Empty layout is activated and I get only the Launcher skin. When I close Notepad from the skin (or manually), the layout containing those lot of skins is activated, I get all those skins.
No endless loop, as far as I can tell.
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by sl23 »

Similar to balala, I have a launcher skin. This and the volume skin ar always active. Any others get deactivated when vlc is launched for example. My launcher is pretty hefty though as it contains lots of other stuff.

But you could add a very basic skin designed solely for this purpose so as to reduce resources used as much as possible. :)
57686174 77696C6C 6265 77696C6C 6265
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by sl23 »

I'm not really understanding what you mean by loop.

Do you mean like if the app that's being monitored causes a skin refresh? Something like that?

I simply monitor several apps if they are opened iget an action. For example, vlc is monitored and on launch the main skin deactivate the others. On close, they are activated.

Or if an emulator is started, it launches a simple screen saver in the background to darken other windows.

No loops. But constant monitoring. But if I added a refresh upon an app being opened or closed, that's the loop you mention, yes?
57686174 77696C6C 6265 77696C6C 6265
User avatar
balala
Rainmeter Sage
Posts: 16568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by balala »

sl23 wrote: August 27th, 2024, 7:37 am Similar to balala, I have a launcher skin. This and the volume skin ar always active. Any others get deactivated when vlc is launched for example. My launcher is pretty hefty though as it contains lots of other stuff.
Create two layouts: one containing only the launcher and the volume skin (let's name this layout VLC), the other containing all skins you want to use when VLC is not running (suggestively let's name this Others). Add VLC to the Additional process list in the Game mode tab of the Manage Rainmeter window (how you have to add the process I don't know, because I'm not using VLC, but it should be something like vlc.exe - you have to figure this out). Click the On start button below the list and check the VLC layout. Click On stop and check Others this time. This is all. When you start VLC (doesn't really matter how), the VLC layout (containing only the launcher and the volume skin) is activated, when you close VLC, the Others layout is activated.
One detail to be kept in mind, which usually doesn't really matter, however in some cases it could, is that even if some skin is included into both layouts (VLC and Others in this case) whenever are you launching or closing VLC, the skin belonging to both layouts is closed and reloaded. This is done because when you activate a layout, all skins are deactivated, then the proper ones are activated. This leads to the "reactivation" of skins included into both layouts.
I think this should work this way.
User avatar
Yincognito
Rainmeter Sage
Posts: 8195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by Yincognito »

balala wrote: August 26th, 2024, 8:09 pm I have a Launcher skin, which can be used to launch and close Notepad. In the Game mode tab of Manage Rainmeter I clicked Additional process list and added Notepad.exe. On the On start button of the Game mode tab, I set up a layout called Empty (which contains only the Launcher skin). On the On close button I set up a layout containing a lot of skins.
Now whenever I launch Notepad from the Launcher skin (or other way), the Empty layout is activated and I get only the Launcher skin. When I close Notepad from the skin (or manually), the layout containing those lot of skins is activated, I get all those skins.
No endless loop, as far as I can tell.
That's because you do this manually, on click. If you were to do it automatically, e.g. check if Notepad is running at the Launcher skin's refresh and based on that activate your Empty layout, it's then when you'll have the endless loop that jsmorley most likely mentioned. That would be because the Launcher skin would again automatically recheck these things and reload that Empty layout (in which it is itself included!) over and over again.

In other words, jsmorley talked about a true "monitoring" skin that does it automatically, while you were referring to a "launcher" skin that does it manually. The issue potentially causing the endless loop in the first case is that the said skin would be itself included in the layout loaded automatically from that same skin.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by sl23 »

Mine is automatically done through a skin, so it is constantly monitoring if the process name is loaded or not. On every update it checks this. Probably not the best way, but it works I see no loop other than:
Skin update / check process / take action.

If there were a refresh on update there, that's the loop referred to isn't it?
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by Yincognito »

The endless loop would occur only if the "monitoring" skin automatically loads a layout that includes that same skin. It would not happen if the "monitoring" skin is simply loading or unloading skins that don't include that same skin. The former case happens basically because of "self inclusion" of the "monitoring" skin in the layout you load, while the latter case can work just fine as long as that "self inclusion" doesn't happen.

Example 1: monitoring skin = S1, loaded layout = L1 or L2 (both including S1), layout loading = automatic on refreshing S1, effect = endless loop
Example 2: monitoring skin = S1, loaded / unloaded skins = S2 to S9 (no S1), loading / unloading skins = whatever, effect = no endless loop
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by jsmorley »

Correct, a Layout will reload all skins.
User avatar
balala
Rainmeter Sage
Posts: 16568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by balala »

Yincognito wrote: August 27th, 2024, 8:41 am If you were to do it automatically, e.g. check if Notepad is running at the Launcher skin's refresh and based on that activate your Empty layout, it's then when you'll have the endless loop that jsmorley most likely mentioned.
Activating a layout at a skin refresh (based on a condition for instance) is definitely a non-sense. This would make sense only if the skin checking the condition and activating the layout could be kept activated and would not be deactivated by loading the layout. Since there is no such way, doesn't make sense.
User avatar
Yincognito
Rainmeter Sage
Posts: 8195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Rainmeter automatically enabling "Game Mode" whenever desktop is not shown

Post by Yincognito »

balala wrote: August 27th, 2024, 11:15 am Activating a layout at a skin refresh (based on a condition for instance) is definitely a non-sense. This would make sense only if the skin checking the condition and activating the layout could be kept activated and would not be deactivated by loading the layout. Since there is no such way, doesn't make sense.
If that skin is just monitoring for the execution of a program, it's irrelevant if it's deactivated for a few milliseconds before activating it again when presumably loading the alternate layout. You'd only need to avoid that "condition" having the same true / false value and prevent the same layout being loaded indefinitely in an endless loop. This could be done by saving in an .inc file whether the same layout was loaded previously or not and use that in the "condition", like mentioned earlier in the thread.

Anyway, we probably refer to different approaches regarding the thread's supposed subject, so it's all hypothetical, until the question has a better clarity and some potential code is written regarding this. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth