FZ: fix incorrect snapping zoning behavior caused by calling MessageBox from LLKBHook cb (#8473)
* Revert "add logging to hide/show window and shift press (#8392)"
This reverts commit df3d007a1b
.
* FZ: fix incorrect snapping zoning behavior caused by calling MessageBox from LLKBHook cb
This commit is contained in:
parent
292939c4a1
commit
9d0d5db948
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <common/common.h>
|
||||
#include <common/dpi_aware.h>
|
||||
#include <common/logger/logger.h>
|
||||
#include <common/on_thread_executor.h>
|
||||
#include <common/window_helpers.h>
|
||||
|
||||
|
@ -535,9 +534,6 @@ FancyZones::OnKeyDown(PKBDLLHOOKSTRUCT info) noexcept
|
|||
bool const win = GetAsyncKeyState(VK_LWIN) & 0x8000 || GetAsyncKeyState(VK_RWIN) & 0x8000;
|
||||
bool const alt = GetAsyncKeyState(VK_MENU) & 0x8000;
|
||||
bool const ctrl = GetAsyncKeyState(VK_CONTROL) & 0x8000;
|
||||
|
||||
Logger::trace("OnKeyDown: shift {}", shift);
|
||||
|
||||
if ((win && !shift && !ctrl) || (win && ctrl && alt))
|
||||
{
|
||||
// Temporarily disable Win+Ctrl+Number functionality
|
||||
|
@ -574,10 +570,8 @@ FancyZones::OnKeyDown(PKBDLLHOOKSTRUCT info) noexcept
|
|||
|
||||
if (m_windowMoveHandler.IsDragEnabled() && shift)
|
||||
{
|
||||
Logger::trace("OnKeyDown: drag enabled -> return true");
|
||||
return true;
|
||||
}
|
||||
Logger::trace("OnKeyDown: return false");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -640,7 +634,7 @@ void FancyZones::ToggleEditor() noexcept
|
|||
|
||||
const bool spanZonesAcrossMonitors = m_settings->GetSettings()->spanZonesAcrossMonitors;
|
||||
params += std::to_wstring(spanZonesAcrossMonitors) + divider; /* Span zones */
|
||||
|
||||
|
||||
std::vector<std::pair<HMONITOR, MONITORINFOEX>> allMonitors;
|
||||
allMonitors = FancyZonesUtils::GetAllMonitorInfo<&MONITORINFOEX::rcWork>();
|
||||
|
||||
|
@ -697,10 +691,16 @@ void FancyZones::ToggleEditor() noexcept
|
|||
|
||||
if (showDpiWarning)
|
||||
{
|
||||
MessageBoxW(NULL,
|
||||
GET_RESOURCE_STRING(IDS_SPAN_ACROSS_ZONES_WARNING).c_str(),
|
||||
GET_RESOURCE_STRING(IDS_POWERTOYS_FANCYZONES).c_str(),
|
||||
MB_OK | MB_ICONWARNING);
|
||||
// We must show the message box in a separate thread, since this code is called from a low-level
|
||||
// keyboard hook callback, and launching messageboxes from it has unexpected side effects,
|
||||
// like triggering EVENT_SYSTEM_MOVESIZEEND prematurely.
|
||||
// TODO: understand the root cause of this, until then it's commented out.
|
||||
//std::thread{ [] {
|
||||
// MessageBoxW(nullptr,
|
||||
// GET_RESOURCE_STRING(IDS_SPAN_ACROSS_ZONES_WARNING).c_str(),
|
||||
// GET_RESOURCE_STRING(IDS_POWERTOYS_FANCYZONES).c_str(),
|
||||
// MB_OK | MB_ICONWARNING);
|
||||
//} }.detach();
|
||||
}
|
||||
|
||||
const auto& fancyZonesData = FancyZonesDataInstance();
|
||||
|
@ -1294,7 +1294,6 @@ bool FancyZones::IsSplashScreen(HWND window)
|
|||
|
||||
void FancyZones::OnEditorExitEvent() noexcept
|
||||
{
|
||||
Logger::trace("OnEditorExitEvent");
|
||||
// Collect information about changes in zone layout after editor exited.
|
||||
FancyZonesDataInstance().ParseDataFromTmpFiles();
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "pch.h"
|
||||
|
||||
#include <common/common.h>
|
||||
#include <common/logger/logger.h>
|
||||
#include <common/on_thread_executor.h>
|
||||
|
||||
#include "FancyZonesData.h"
|
||||
|
@ -319,11 +318,9 @@ ZoneWindow::SaveWindowProcessToZoneIndex(HWND window) noexcept
|
|||
IFACEMETHODIMP_(void)
|
||||
ZoneWindow::ShowZoneWindow() noexcept
|
||||
{
|
||||
Logger::trace("ShowZoneWindow: Enter");
|
||||
auto window = m_window.get();
|
||||
if (!window)
|
||||
{
|
||||
Logger::trace("ShowZoneWindow: no window");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -345,16 +342,11 @@ ZoneWindow::HideZoneWindow() noexcept
|
|||
{
|
||||
if (m_window)
|
||||
{
|
||||
Logger::trace("HideZoneWindow: hiding");
|
||||
m_zoneWindowDrawing->Hide();
|
||||
m_keyLast = 0;
|
||||
m_windowMoveSize = nullptr;
|
||||
m_highlightZone = {};
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger::trace("HideZoneWindow: no window");
|
||||
}
|
||||
}
|
||||
|
||||
IFACEMETHODIMP_(void)
|
||||
|
|
Loading…
Reference in a new issue