StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
johnwang  
#1 Posted : Thursday, March 10, 2022 5:06:57 PM(UTC)
johnwang

Rank: Member

Reputation:

Groups: Approved
Joined: 4/2/2020(UTC)
Posts: 11
United States

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
So I think I have a bit of an edge case here. I have a Foreground Window Change script that calls a function defined in the Load script. When my computer resumes from sleep and I log in, I have strokesplus auto-reload itself. However, if I happen to click a different window or something when it's doing it's reload, the Foreground Window Change event fires and calls an undefined function because the reload hasn't completed.

It's not a huge deal since I can handle it like this, though I'm wondering if events should be disabled until SP has fully reloaded?

if (typeof(UpdateForegroundWindow) === "function") {
UpdateForegroundWindow(false);
}
Rob  
#2 Posted : Sunday, March 20, 2022 8:52:25 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
I'm tempted to leave it as it is, simply because someone may be using it in a way where they must always get the event - and some code wouldn't care if the reload is complete (like a static plug-in, stored value, etc.).

Yeah, your check works or just wrapping it in a try/catch.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.