mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-04 11:59:07 +08:00
[KBM] Constrain the buttons such that only one of the windows can be opened (#2566)
* Bypass XamlBridge Window focus handling * Constrain only one window can be opened at a time * Revert changes on files changed in another PR * Changed WM_DESTROY to WM_NCDESTROY Co-authored-by: Tomas Raies <tomas.raies@gmail.com>
This commit is contained in:
parent
06fcc2bf46
commit
8e18104f38
@ -225,14 +225,14 @@ public:
|
||||
|
||||
if (action_object.get_name() == L"RemapKeyboard")
|
||||
{
|
||||
if (!CheckEditKeyboardWindowActive())
|
||||
if (!CheckEditKeyboardWindowActive() && !CheckEditShortcutsWindowActive())
|
||||
{
|
||||
std::thread(createEditKeyboardWindow, hInstance, std::ref(keyboardManagerState)).detach();
|
||||
}
|
||||
}
|
||||
else if (action_object.get_name() == L"EditShortcut")
|
||||
{
|
||||
if (!CheckEditShortcutsWindowActive())
|
||||
if (!CheckEditKeyboardWindowActive() && !CheckEditShortcutsWindowActive())
|
||||
{
|
||||
std::thread(createEditShortcutsWindow, hInstance, std::ref(keyboardManagerState)).detach();
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ LRESULT CALLBACK EditKeyboardWindowProc(HWND hWnd, UINT messageCode, WPARAM wPar
|
||||
{
|
||||
return xamlBridgePtr->MessageHandler(messageCode, wParam, lParam);
|
||||
}
|
||||
else if (messageCode == WM_DESTROY)
|
||||
else if (messageCode == WM_NCDESTROY)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
@ -274,7 +274,7 @@ LRESULT CALLBACK EditShortcutsWindowProc(HWND hWnd, UINT messageCode, WPARAM wPa
|
||||
{
|
||||
return xamlBridgePtr->MessageHandler(messageCode, wParam, lParam);
|
||||
}
|
||||
else if (messageCode == WM_DESTROY)
|
||||
else if (messageCode == WM_NCDESTROY)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
@ -289,7 +289,7 @@ LRESULT XamlBridge::MessageHandler(UINT const message, WPARAM const wParam, LPAR
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
HANDLE_MSG(parentWindow, WM_DESTROY, OnDestroy);
|
||||
HANDLE_MSG(parentWindow, WM_NCDESTROY, OnDestroy);
|
||||
HANDLE_MSG(parentWindow, WM_ACTIVATE, OnActivate);
|
||||
HANDLE_MSG(parentWindow, WM_SETFOCUS, OnSetFocus);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user