mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
facebook messenger style (#30185)
This commit is contained in:
@@ -34,12 +34,13 @@ FancyZonesWindowProcessing::ProcessabilityType FancyZonesWindowProcessing::Defin
|
|||||||
|
|
||||||
bool isPopup = FancyZonesWindowUtils::HasStyle(style, WS_POPUP);
|
bool isPopup = FancyZonesWindowUtils::HasStyle(style, WS_POPUP);
|
||||||
bool hasThickFrame = FancyZonesWindowUtils::HasStyle(style, WS_THICKFRAME);
|
bool hasThickFrame = FancyZonesWindowUtils::HasStyle(style, WS_THICKFRAME);
|
||||||
bool hasCaption = FancyZonesWindowUtils::HasStyle(style, WS_CAPTION);
|
bool hasCaption = FancyZonesWindowUtils::HasStyle(style, WS_CAPTION);
|
||||||
if (isPopup && !(hasThickFrame && hasCaption))
|
bool hasMinimizeMaximizeButtons = FancyZonesWindowUtils::HasStyle(style, WS_MINIMIZEBOX) || FancyZonesWindowUtils::HasStyle(style, WS_MAXIMIZEBOX);
|
||||||
|
if (isPopup && !(hasThickFrame && (hasCaption || hasMinimizeMaximizeButtons)))
|
||||||
{
|
{
|
||||||
// popup windows we want to snap: e.g. Calculator, Telegram
|
// popup windows we want to snap: e.g. Calculator, Telegram
|
||||||
// popup windows we don't want to snap: start menu, notification popup, tray window, etc.
|
// popup windows we don't want to snap: start menu, notification popup, tray window, etc.
|
||||||
// WS_CAPTION is used for filtering out menus,
|
// WS_CAPTION, WS_MINIMIZEBOX, WS_MAXIMIZEBOX are used for filtering out menus,
|
||||||
// e.g., in Edge "Running as admin" menu when creating a new PowerToys issue.
|
// e.g., in Edge "Running as admin" menu when creating a new PowerToys issue.
|
||||||
return ProcessabilityType::NonProcessablePopupWindow;
|
return ProcessabilityType::NonProcessablePopupWindow;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,14 @@ namespace FancyZonesUnitTests
|
|||||||
Assert::IsTrue(FancyZonesWindowProcessing::IsProcessable(window));
|
Assert::IsTrue(FancyZonesWindowProcessing::IsProcessable(window));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_METHOD(Popup_FacebookMessenger)
|
||||||
|
{
|
||||||
|
HWND window = Mocks::WindowCreate(hInst, L"", L"", 0, WS_GROUP | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_TABSTOP | WS_THICKFRAME);
|
||||||
|
|
||||||
|
Assert::AreEqual(FancyZonesWindowProcessing::ProcessabilityType::Processable, FancyZonesWindowProcessing::DefineWindowType(window));
|
||||||
|
Assert::IsTrue(FancyZonesWindowProcessing::IsProcessable(window));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_METHOD (ChildWindow_OptionDisabled)
|
TEST_METHOD (ChildWindow_OptionDisabled)
|
||||||
{
|
{
|
||||||
FancyZonesSettings::instance().SetSettings(Settings{ .allowSnapChildWindows = false });
|
FancyZonesSettings::instance().SetSettings(Settings{ .allowSnapChildWindows = false });
|
||||||
|
|||||||
Reference in New Issue
Block a user