mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-30 05:57:42 +00:00
[FancyZones]"Switch between windows in the current zone" works after disabling fix (#27416)
* update hotkeys on setting change * next tab hotkey
This commit is contained in:
parent
602368f6cc
commit
ed44db25e3
@ -64,7 +64,7 @@ struct FancyZones : public winrt::implements<FancyZones, IFancyZones, IFancyZone
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FancyZones(HINSTANCE hinstance, std::function<void()> disableModuleCallbackFunction) noexcept :
|
FancyZones(HINSTANCE hinstance, std::function<void()> disableModuleCallbackFunction) noexcept :
|
||||||
SettingsObserver({ SettingId::EditorHotkey, SettingId::PrevTabHotkey, SettingId::NextTabHotkey, SettingId::SpanZonesAcrossMonitors }),
|
SettingsObserver({ SettingId::EditorHotkey, SettingId::WindowSwitching, SettingId::PrevTabHotkey, SettingId::NextTabHotkey, SettingId::SpanZonesAcrossMonitors }),
|
||||||
m_hinstance(hinstance),
|
m_hinstance(hinstance),
|
||||||
m_draggingState([this]() {
|
m_draggingState([this]() {
|
||||||
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
|
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
|
||||||
@ -218,23 +218,9 @@ FancyZones::Run() noexcept
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RegisterHotKey(m_window, static_cast<int>(HotkeyId::Editor), FancyZonesSettings::settings().editorHotkey.get_modifiers(), FancyZonesSettings::settings().editorHotkey.get_code()))
|
UpdateHotkey(static_cast<int>(HotkeyId::Editor), FancyZonesSettings::settings().editorHotkey, true);
|
||||||
{
|
UpdateHotkey(static_cast<int>(HotkeyId::PrevTab), FancyZonesSettings::settings().prevTabHotkey, FancyZonesSettings::settings().windowSwitching);
|
||||||
Logger::error(L"Failed to register hotkey: {}", get_last_error_or_default(GetLastError()));
|
UpdateHotkey(static_cast<int>(HotkeyId::NextTab), FancyZonesSettings::settings().nextTabHotkey, FancyZonesSettings::settings().windowSwitching);
|
||||||
}
|
|
||||||
|
|
||||||
if (FancyZonesSettings::settings().windowSwitching)
|
|
||||||
{
|
|
||||||
if (!RegisterHotKey(m_window, static_cast<int>(HotkeyId::NextTab), FancyZonesSettings::settings().nextTabHotkey.get_modifiers(), FancyZonesSettings::settings().nextTabHotkey.get_code()))
|
|
||||||
{
|
|
||||||
Logger::error(L"Failed to register hotkey: {}", get_last_error_or_default(GetLastError()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!RegisterHotKey(m_window, static_cast<int>(HotkeyId::PrevTab), FancyZonesSettings::settings().prevTabHotkey.get_modifiers(), FancyZonesSettings::settings().prevTabHotkey.get_code()))
|
|
||||||
{
|
|
||||||
Logger::error(L"Failed to register hotkey: {}", get_last_error_or_default(GetLastError()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize COM. Needed for WMI monitor identifying
|
// Initialize COM. Needed for WMI monitor identifying
|
||||||
HRESULT comInitHres = CoInitializeEx(0, COINIT_MULTITHREADED);
|
HRESULT comInitHres = CoInitializeEx(0, COINIT_MULTITHREADED);
|
||||||
@ -1172,6 +1158,12 @@ void FancyZones::SettingsUpdate(SettingId id)
|
|||||||
UpdateHotkey(static_cast<int>(HotkeyId::Editor), FancyZonesSettings::settings().editorHotkey, true);
|
UpdateHotkey(static_cast<int>(HotkeyId::Editor), FancyZonesSettings::settings().editorHotkey, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SettingId::WindowSwitching:
|
||||||
|
{
|
||||||
|
UpdateHotkey(static_cast<int>(HotkeyId::PrevTab), FancyZonesSettings::settings().prevTabHotkey, FancyZonesSettings::settings().windowSwitching);
|
||||||
|
UpdateHotkey(static_cast<int>(HotkeyId::NextTab), FancyZonesSettings::settings().nextTabHotkey, FancyZonesSettings::settings().windowSwitching);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SettingId::PrevTabHotkey:
|
case SettingId::PrevTabHotkey:
|
||||||
{
|
{
|
||||||
UpdateHotkey(static_cast<int>(HotkeyId::PrevTab), FancyZonesSettings::settings().prevTabHotkey, FancyZonesSettings::settings().windowSwitching);
|
UpdateHotkey(static_cast<int>(HotkeyId::PrevTab), FancyZonesSettings::settings().prevTabHotkey, FancyZonesSettings::settings().windowSwitching);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user