mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-11 12:14:53 +08:00
[VCM]Only use File Watchers if module is enabled (#22757)
This commit is contained in:
parent
d50b89262c
commit
150f26731c
@ -311,11 +311,7 @@ void VideoConferenceModule::onMicrophoneConfigurationChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoConferenceModule::VideoConferenceModule() :
|
VideoConferenceModule::VideoConferenceModule()
|
||||||
_generalSettingsWatcher{ PTSettingsHelper::get_powertoys_general_save_file_location(), [this] {
|
|
||||||
toolbar.scheduleGeneralSettingsUpdate();
|
|
||||||
} },
|
|
||||||
_moduleSettingsWatcher{ PTSettingsHelper::get_module_save_file_location(get_key()), [this] { toolbar.scheduleModuleSettingsUpdate(); } }
|
|
||||||
{
|
{
|
||||||
init_settings();
|
init_settings();
|
||||||
_settingsUpdateChannel =
|
_settingsUpdateChannel =
|
||||||
@ -524,6 +520,15 @@ void VideoConferenceModule::enable()
|
|||||||
{
|
{
|
||||||
if (!_enabled)
|
if (!_enabled)
|
||||||
{
|
{
|
||||||
|
_generalSettingsWatcher = std::make_unique<FileWatcher> (
|
||||||
|
PTSettingsHelper::get_powertoys_general_save_file_location(), [this] {
|
||||||
|
toolbar.scheduleGeneralSettingsUpdate();
|
||||||
|
});
|
||||||
|
_moduleSettingsWatcher = std::make_unique<FileWatcher> (
|
||||||
|
PTSettingsHelper::get_module_save_file_location(get_key()), [this] {
|
||||||
|
toolbar.scheduleModuleSettingsUpdate();
|
||||||
|
});
|
||||||
|
|
||||||
toggleProxyCamRegistration(true);
|
toggleProxyCamRegistration(true);
|
||||||
toolbar.setMicrophoneMute(getMicrophoneMuteState());
|
toolbar.setMicrophoneMute(getMicrophoneMuteState());
|
||||||
toolbar.setCameraMute(getVirtualCameraMuteState());
|
toolbar.setCameraMute(getVirtualCameraMuteState());
|
||||||
@ -572,6 +577,8 @@ void VideoConferenceModule::disable()
|
|||||||
{
|
{
|
||||||
if (_enabled)
|
if (_enabled)
|
||||||
{
|
{
|
||||||
|
_generalSettingsWatcher.reset();
|
||||||
|
_moduleSettingsWatcher.reset();
|
||||||
toggleProxyCamRegistration(false);
|
toggleProxyCamRegistration(false);
|
||||||
if (hook_handle)
|
if (hook_handle)
|
||||||
{
|
{
|
||||||
|
@ -88,8 +88,8 @@ private:
|
|||||||
std::optional<SerializedSharedMemory> _imageOverlayChannel;
|
std::optional<SerializedSharedMemory> _imageOverlayChannel;
|
||||||
std::optional<SerializedSharedMemory> _settingsUpdateChannel;
|
std::optional<SerializedSharedMemory> _settingsUpdateChannel;
|
||||||
|
|
||||||
FileWatcher _generalSettingsWatcher;
|
std::unique_ptr<FileWatcher> _generalSettingsWatcher;
|
||||||
FileWatcher _moduleSettingsWatcher;
|
std::unique_ptr<FileWatcher> _moduleSettingsWatcher;
|
||||||
|
|
||||||
static VideoConferenceSettings settings;
|
static VideoConferenceSettings settings;
|
||||||
static Toolbar toolbar;
|
static Toolbar toolbar;
|
||||||
|
Loading…
Reference in New Issue
Block a user