mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-11 12:14:53 +08:00
Expose InMoveSize from WindowMoveHandler. (#3525)
This commit is contained in:
parent
c7fb1f6d17
commit
1792849b98
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,11 @@ namespace FancyZonesUnitTests
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
IFACEMETHODIMP_(bool)
|
||||||
|
InMoveSize() noexcept
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
IZoneWindow* m_zoneWindow;
|
IZoneWindow* m_zoneWindow;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user