Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1056

Bugs & Feature Suggestions • [BUG] FadeDuration below 0 prevents skins from unloading

$
0
0
How to reproduce
  1. Set any skin's FadeDuration to below 0 (I went with -1)
    (you can also alternatively do [!FadeDuration "-1"])
  2. Save the Settings file
  3. Try to unload a skin
  4. Skin will not unload, context action options also don't appear anymore, Manage Rainmeter says the skin is unloaded
Example
https://i.imgur.com/3LD1VDb.mp4

Why it happens and potential place to fix
I tried to look at the code but I wasn't able to put my hand on why it happens, the code deactivating a skin should be found in here. Surprisngly, Skin::Deactivate() isn't the one that Disposes of the skin in memory (I actually can't tell how it gets deactivated or what ~Skin() means), as for stuff inside the Deactivate function, GetRainmeter().RemoveSkin(this); and GetRainmeter().AddUnmanagedSkin(this); both get executed correctly, so I think it's safe to assume m_State = STATE_CLOSING before them also gets executed and the line before, if (m_State == STATE_CLOSING) return; will just make everything below where it's placed not work, so when the 2nd skin gets loaded over, the first one is gonna make it impossible to ever receive meaningful input in that function.

Whatever, as for potential fixes, this problem can also be triggered by [!FadeDuration "-1"]) (thanks to Skin::UpdateFadeDuration()), so we should be a bit cautious
I think modifying the logic to be max(a,b) on the following lines should be enough though without messing stuff up
Line 140: SetTimer(m_Window, TIMER_DEACTIVATE, max(0, m_FadeDuration) + 50, nullptr);
Line 4221: m_FadeDuration = max(0, m_NewFadeDuration);
Line 2254: the line m_FadeDuration = max(0, m_FadeDuration); should be added after line 2254

Fixes
Close and start Rainmeter again

Alternative titles for the bug:
"How do I make a skin appear on both desktops?"
"How do I duplicate a skin?"

Pros/Cons
  • This is actually quite fun
  • Especially the multiple windows, sadly they don't share the same pointer to measures between them, the windows create the measures for each window
  • (Technically) Memory leak :((((((

Statistics: Posted by Jeff — Yesterday, 11:04 pm



Viewing all articles
Browse latest Browse all 1056

Trending Articles