Expose InMoveSize from WindowMoveHandler. (#3525)

This commit is contained in:
vldmr11080 2020-05-22 16:42:29 +02:00 committed by GitHub
parent c7fb1f6d17
commit 1792849b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View File

@ -55,14 +55,6 @@ public:
IFACEMETHODIMP_(void) IFACEMETHODIMP_(void)
Destroy() noexcept; Destroy() noexcept;
// IFancyZonesCallback
IFACEMETHODIMP_(bool)
InMoveSize() noexcept
{
std::shared_lock readLock(m_lock);
return m_windowMoveHandler.InMoveSize();
}
void MoveSizeStart(HWND window, HMONITOR monitor, POINT const& ptScreen) noexcept void MoveSizeStart(HWND window, HMONITOR monitor, POINT const& ptScreen) noexcept
{ {
std::unique_lock writeLock(m_lock); std::unique_lock writeLock(m_lock);
@ -185,6 +177,13 @@ public:
return m_settings->GetSettings()->makeDraggedWindowTransparent; return m_settings->GetSettings()->makeDraggedWindowTransparent;
} }
IFACEMETHODIMP_(bool)
InMoveSize() noexcept
{
std::shared_lock readLock(m_lock);
return m_windowMoveHandler.InMoveSize();
}
LRESULT WndProc(HWND, UINT, WPARAM, LPARAM) noexcept; LRESULT WndProc(HWND, UINT, WPARAM, LPARAM) noexcept;
void OnDisplayChange(DisplayChangeType changeType) noexcept; void OnDisplayChange(DisplayChangeType changeType) noexcept;
void AddZoneWindow(HMONITOR monitor, PCWSTR deviceId) noexcept; void AddZoneWindow(HMONITOR monitor, PCWSTR deviceId) noexcept;

View File

@ -81,9 +81,13 @@ interface __declspec(uuid("{5C8D99D6-34B2-4F4A-A8E5-7483F6869775}")) IZoneWindow
*/ */
IFACEMETHOD_(int, GetZoneHighlightOpacity)() = 0; IFACEMETHOD_(int, GetZoneHighlightOpacity)() = 0;
/** /**
* @returns Bool indicating if dragged window should be transparrent * @returns Boolean indicating if dragged window should be transparrent.
*/ */
IFACEMETHOD_(bool, isMakeDraggedWindowTransparentActive) () = 0; IFACEMETHOD_(bool, isMakeDraggedWindowTransparentActive) () = 0;
/**
* @returns Boolean indicating if move/size operation is currently active.
*/
IFACEMETHOD_(bool, InMoveSize) () = 0;
}; };
winrt::com_ptr<IFancyZones> MakeFancyZones(HINSTANCE hinstance, const winrt::com_ptr<IFancyZonesSettings>& settings) noexcept; winrt::com_ptr<IFancyZones> MakeFancyZones(HINSTANCE hinstance, const winrt::com_ptr<IFancyZonesSettings>& settings) noexcept;

View File

@ -522,7 +522,7 @@ ZoneWindow::ShowZoneWindow() noexcept
std::thread{ [=]() { std::thread{ [=]() {
AnimateWindow(window, m_showAnimationDuration, AW_BLEND); AnimateWindow(window, m_showAnimationDuration, AW_BLEND);
InvalidateRect(window, nullptr, true); InvalidateRect(window, nullptr, true);
if (m_windowMoveSize == nullptr) if (!m_host->InMoveSize())
{ {
HideZoneWindow(); HideZoneWindow();
} }

View File

@ -47,6 +47,11 @@ namespace FancyZonesUnitTests
{ {
return true; return true;
} }
IFACEMETHODIMP_(bool)
InMoveSize() noexcept
{
return true;
}
IZoneWindow* m_zoneWindow; IZoneWindow* m_zoneWindow;
}; };