[FancyZones]Modern apps snapping fix, refactor and tests (#29499)

* popup windows check

* use minimize maximize buttons check

* update test utils

* added tests

* define types for easier testing

* changed checks order

* remove option check

* upd test

* remove FZ popup option

* max min buttons -> caption

* calculator test

* updated excluded tests

* add asserts to child window test

* update window creation

* splash screen refactor

* remove hotfix part

* replace style checking functions

* remove no longer necessary check

* tool window check fix

* fix mouse snapping check

* added check and test for non-root window

* spelling

* Revert "remove FZ popup option"

This reverts commit 26732ad683.

* skip child window tests in CI

* remove the option

* remove the constant

* updated tests
This commit is contained in:
Seraphima Zykova
2023-11-21 21:41:55 +01:00
committed by GitHub
parent 1a8007ca0a
commit f9cbff6976
21 changed files with 335 additions and 185 deletions

View File

@@ -20,8 +20,6 @@ WindowMouseSnap::WindowMouseSnap(HWND window, const std::unordered_map<HMONITOR,
m_snappingMode(false)
{
m_windowProperties.hasNoVisibleOwner = !FancyZonesWindowUtils::HasVisibleOwner(m_window);
m_windowProperties.isStandardWindow = FancyZonesWindowUtils::IsStandardWindow(m_window) &&
(!FancyZonesWindowUtils::IsPopupWindow(m_window) || FancyZonesSettings::settings().allowSnapPopupWindows);
}
WindowMouseSnap::~WindowMouseSnap()
@@ -31,8 +29,7 @@ WindowMouseSnap::~WindowMouseSnap()
std::unique_ptr<WindowMouseSnap> WindowMouseSnap::Create(HWND window, const std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>>& activeWorkAreas)
{
if (!FancyZonesWindowProcessing::IsProcessable(window) ||
FancyZonesWindowUtils::IsCursorTypeIndicatingSizeEvent())
if (FancyZonesWindowUtils::IsCursorTypeIndicatingSizeEvent() || !FancyZonesWindowProcessing::IsProcessable(window))
{
return nullptr;
}
@@ -111,13 +108,8 @@ void WindowMouseSnap::MoveSizeUpdate(HMONITOR monitor, POINT const& ptScreen, bo
void WindowMouseSnap::MoveSizeEnd()
{
if (m_snappingMode)
{
const bool hasNoVisibleOwner = !FancyZonesWindowUtils::HasVisibleOwner(m_window);
const bool isStandardWindow = FancyZonesWindowUtils::IsStandardWindow(m_window);
if ((isStandardWindow == false && hasNoVisibleOwner == true &&
m_windowProperties.isStandardWindow == true && m_windowProperties.hasNoVisibleOwner == true) ||
FancyZonesWindowUtils::IsWindowMaximized(m_window))
{
if (FancyZonesWindowUtils::IsWindowMaximized(m_window))
{
// Abort the zoning, this is a Chromium based tab that is merged back with an existing window
// or if the window is maximized by Windows when the cursor hits the screen top border