add logging to hide/show window and shift press (#8392)

This commit is contained in:
Andrey Nekrasov
2020-12-04 17:44:35 +03:00
committed by GitHub
parent dc3e645591
commit df3d007a1b
2 changed files with 14 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
#include <common/common.h> #include <common/common.h>
#include <common/dpi_aware.h> #include <common/dpi_aware.h>
#include <common/logger/logger.h>
#include <common/on_thread_executor.h> #include <common/on_thread_executor.h>
#include <common/window_helpers.h> #include <common/window_helpers.h>
@@ -534,6 +535,9 @@ FancyZones::OnKeyDown(PKBDLLHOOKSTRUCT info) noexcept
bool const win = GetAsyncKeyState(VK_LWIN) & 0x8000 || GetAsyncKeyState(VK_RWIN) & 0x8000; bool const win = GetAsyncKeyState(VK_LWIN) & 0x8000 || GetAsyncKeyState(VK_RWIN) & 0x8000;
bool const alt = GetAsyncKeyState(VK_MENU) & 0x8000; bool const alt = GetAsyncKeyState(VK_MENU) & 0x8000;
bool const ctrl = GetAsyncKeyState(VK_CONTROL) & 0x8000; bool const ctrl = GetAsyncKeyState(VK_CONTROL) & 0x8000;
Logger::trace("OnKeyDown: shift {}", shift);
if ((win && !shift && !ctrl) || (win && ctrl && alt)) if ((win && !shift && !ctrl) || (win && ctrl && alt))
{ {
// Temporarily disable Win+Ctrl+Number functionality // Temporarily disable Win+Ctrl+Number functionality
@@ -570,8 +574,10 @@ FancyZones::OnKeyDown(PKBDLLHOOKSTRUCT info) noexcept
if (m_windowMoveHandler.IsDragEnabled() && shift) if (m_windowMoveHandler.IsDragEnabled() && shift)
{ {
Logger::trace("OnKeyDown: drag enabled -> return true");
return true; return true;
} }
Logger::trace("OnKeyDown: return false");
return false; return false;
} }

View File

@@ -1,6 +1,7 @@
#include "pch.h" #include "pch.h"
#include <common/common.h> #include <common/common.h>
#include <common/logger/logger.h>
#include <common/on_thread_executor.h> #include <common/on_thread_executor.h>
#include "FancyZonesData.h" #include "FancyZonesData.h"
@@ -318,9 +319,11 @@ ZoneWindow::SaveWindowProcessToZoneIndex(HWND window) noexcept
IFACEMETHODIMP_(void) IFACEMETHODIMP_(void)
ZoneWindow::ShowZoneWindow() noexcept ZoneWindow::ShowZoneWindow() noexcept
{ {
Logger::trace("ShowZoneWindow: Enter");
auto window = m_window.get(); auto window = m_window.get();
if (!window) if (!window)
{ {
Logger::trace("ShowZoneWindow: no window");
return; return;
} }
@@ -342,11 +345,16 @@ ZoneWindow::HideZoneWindow() noexcept
{ {
if (m_window) if (m_window)
{ {
Logger::trace("HideZoneWindow: hiding");
m_zoneWindowDrawing->Hide(); m_zoneWindowDrawing->Hide();
m_keyLast = 0; m_keyLast = 0;
m_windowMoveSize = nullptr; m_windowMoveSize = nullptr;
m_highlightZone = {}; m_highlightZone = {};
} }
else
{
Logger::trace("HideZoneWindow: no window");
}
} }
IFACEMETHODIMP_(void) IFACEMETHODIMP_(void)