mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Sync LightSwitch event names, add monitor refresh delay
- Use shared constants for LightSwitch theme event names in both C++ and C# to ensure cross-module consistency. - Replace "Brightness update rate" with "Monitor refresh delay" setting in PowerDisplay; user can now configure delay (1–30s) after display changes before monitor refresh. - Update UI and resources to reflect new setting and remove old references. - MainViewModel now uses the configurable delay instead of a hardcoded value. - Improves user control and reliability of monitor detection after hot-plug events.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <LightSwitchUtils.h>
|
||||
#include "ThemeScheduler.h"
|
||||
#include <ThemeHelper.h>
|
||||
#include <common/interop/shared_constants.h>
|
||||
|
||||
void ApplyTheme(bool shouldBeLight);
|
||||
|
||||
@@ -300,8 +301,8 @@ void LightSwitchStateManager::NotifyPowerDisplay(bool isLight)
|
||||
// Using separate events for light/dark eliminates race conditions where PowerDisplay
|
||||
// might read the registry before LightSwitch has finished updating it
|
||||
const wchar_t* eventName = isLight
|
||||
? L"Local\\PowerToys_LightSwitch_LightTheme"
|
||||
: L"Local\\PowerToys_LightSwitch_DarkTheme";
|
||||
? CommonSharedConstants::LIGHT_SWITCH_LIGHT_THEME_EVENT
|
||||
: CommonSharedConstants::LIGHT_SWITCH_DARK_THEME_EVENT;
|
||||
|
||||
Logger::info(L"[LightSwitchStateManager] Notifying PowerDisplay about theme change (isLight: {})", isLight);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user