ModernFlyouts icon indicating copy to clipboard operation
ModernFlyouts copied to clipboard

Bug: Switching themes causes crash

Open karpovv-boris opened this issue 4 years ago • 4 comments

Describe the bug: Playing with themes in Windows setting causes crash

To Reproduce: Steps to reproduce the behavior:

  1. Open Windows Settings
  2. Then Personalisation
  3. Then Colors
  4. Switch between themes for application
  5. Switch between system themes
  6. Crash (Switching back to system dark theme will cause crash)

Reliable monitor: exception code highlightied Screenshot_4

Gif:

Show

bug

OS Version:

  • Windows 10 Version: 20H2

ModernFlyouts Version:

  • Version: v0.9.1.0

Additional context: Full stack trace here: https://pastebin.com/idCMuRgx

karpovv-boris avatar Mar 24 '21 08:03 karpovv-boris

Can confirm this one, since I have tasks scheduled to run and switch system themes at certain times of the day (i.e. when it's night or first thing in the morning) and the app crashes whenever the theme switching happens.

mateusmlo avatar Mar 27 '21 13:03 mateusmlo

Can confirm this one, since I have tasks scheduled to run and switch system themes at certain times of the day (i.e. when it's night or first thing in the morning) and the app crashes whenever the theme switching happens.

Off topic, try f.lux. Screenshot_1

karpovv-boris avatar Mar 27 '21 14:03 karpovv-boris

https://github.com/ModernFlyouts-Community/ModernFlyouts/issues/557#issue-855057601

Describe the bug: (Found a similar issue #522 , maybe you can close this one after you solve it :) ) I use Auto Dark Mode for auto-switching my theme. Every time the theme change happens, the app just crashes. Soon after the switch, I can invoke the flyout while I can't open the setting panel. A hour (maybe sooner) after the switch, the app will be totally down. To Reproduce: Steps to reproduce the behavior: Install and launch Auto Dark Mode Wait or invoke a theme change (taskbar color and app theme included) The setting panel starts to crash The whole app is down. Screenshots: (It will crash, so no screenshots 😥) OS Version: Windows 10 Version: 21H1 (19043.906) ModernFlyouts Version: Version: 0.9.0.1 (Latest for now)

Samuel12321 avatar Apr 10 '21 20:04 Samuel12321

For anyone looking for a workaround, I wrote a script to automatically restart ModernFlyouts when a crash happens. Let me know if there's anything that needs changed.

modernflyouts.vbs:

Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run("powershell -windowstyle hidden -executionpolicy bypass -noninteractive & { $app = (get-appxpackage -name 32669SamG.ModernFlyouts | select -expandproperty PackageFamilyName) ; start shell:appsfolder\$app!App } "),0
Set WshShell = Nothing

You will need to provide the path to the script as a program argument in the task.

Task Scheduler:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Description>Run ModernFlyouts app for volume and brightness control.</Description>
    <URI>\Modern Flyouts</URI>
  </RegistrationInfo>
  <Triggers>
    <EventTrigger>
      <Enabled>true</Enabled>
      <Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Application"&gt;&lt;Select Path="Application"&gt;
	*[System[(Level=2) and (EventID=1000)]]
	and
	*[EventData[(Data='ModernFlyoutsHost.exe')]]
    &lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
    </EventTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>Queue</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>false</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>false</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
    <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>WScript.exe</Command>
      <Arguments></Arguments>
    </Exec>
  </Actions>
</Task>

andreaxhearts avatar Jul 28 '24 13:07 andreaxhearts