You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the enhancement or feature you'd like
Allow some sort of setting, either in the scripts spec or the UI, to finish executing custom scripts before theme change
Describe alternatives you've considered
Disable theme switching and turn that into a script with a delay
Additional context
I'm trying to use AutoDarkMode in conjunction with an .msstyles theme (specifically, Rectify11's). Currently AutoDarkMode seems like it toggles both the .msstyles theme (through my script) and the normal theme at once, causing long delays and as if no .msstyles change at all has occurred.
The text was updated successfully, but these errors were encountered:
The issues you're most likely running into are probably these two:
Scripts in ADM run asynchronously. They will be launched, but ADM will not wait for them to finish execution before proceeding. So if you have a long running operation, you will experience the behavior your described.
Applying .msstyles is also asynchronous. The method that Rectify11 is using is most likely also non-blocking, resulting in the script to return even though the underlying switch is still ongoing.
As for 1), with scripts it's currently not possible to hook into ADM's switch in a blocking way except for making all scripts run synchronously (which would be a bad idea).
The quickest way of fixing this that I'm seeing would be by making the HandleSwitch method of the ScriptSwitch component synchronous.
Then, with a new configurable option for scripts to run in a blocking manner (disabled by default), the scripts that should run synchronously will be run on the component handler thread, whereas the others still run on a script handler thread.
With the amount of time I have at my disposal at the moment, I am unable to work on this.
However I'm noting this down for future references or if someone wants to have a go.
Describe the enhancement or feature you'd like
Allow some sort of setting, either in the scripts spec or the UI, to finish executing custom scripts before theme change
Describe alternatives you've considered
Disable theme switching and turn that into a script with a delay
Additional context
I'm trying to use AutoDarkMode in conjunction with an .msstyles theme (specifically, Rectify11's). Currently AutoDarkMode seems like it toggles both the .msstyles theme (through my script) and the normal theme at once, causing long delays and as if no .msstyles change at all has occurred.
The text was updated successfully, but these errors were encountered: