[FancyZones] Shift + StickyKeys behavior fix (#6039)

This commit is contained in:
Seraphima Zykova
2020-08-24 10:19:39 +03:00
committed by GitHub
parent f64df97652
commit 845bb466c6
8 changed files with 94 additions and 109 deletions

View File

@@ -17,7 +17,6 @@
#include "MonitorWorkAreaHandler.h"
#include <lib/SecondaryMouseButtonsHook.h>
#include <lib/GenericKeyHook.h>
enum class DisplayChangeType
{
@@ -46,10 +45,9 @@ public:
FancyZones(HINSTANCE hinstance, const winrt::com_ptr<IFancyZonesSettings>& settings) noexcept :
m_hinstance(hinstance),
m_settings(settings),
m_mouseHook(std::bind(&FancyZones::OnMouseDown, this)),
m_shiftHook(std::bind(&FancyZones::OnShiftChangeState, this, std::placeholders::_1)),
m_ctrlHook(std::bind(&FancyZones::OnCtrlChangeState, this, std::placeholders::_1)),
m_windowMoveHandler(settings, &m_mouseHook, &m_shiftHook, &m_ctrlHook)
m_windowMoveHandler(settings, [this]() {
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
})
{
m_settings->SetCallback(this);
}
@@ -60,27 +58,6 @@ public:
IFACEMETHODIMP_(void)
Destroy() noexcept;
void OnMouseDown() noexcept
{
m_windowMoveHandler.OnMouseDown();
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
}
void OnShiftChangeState(bool state) noexcept
{
m_windowMoveHandler.OnShiftChangeState(state);
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
}
void OnCtrlChangeState(bool state) noexcept
{
m_windowMoveHandler.OnCtrlChangeState(state);
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
}
void MoveSizeStart(HWND window, HMONITOR monitor, POINT const& ptScreen) noexcept
{
std::unique_lock writeLock(m_lock);
@@ -267,9 +244,6 @@ private:
HWND m_window{};
WindowMoveHandler m_windowMoveHandler;
MonitorWorkAreaHandler m_workAreaHandler;
SecondaryMouseButtonsHook m_mouseHook;
ShiftKeyHook m_shiftHook;
CtrlKeyHook m_ctrlHook;
winrt::com_ptr<IFancyZonesSettings> m_settings{};
GUID m_previousDesktopId{}; // UUID of previously active virtual desktop.