mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01: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 hasThickFrame = FancyZonesWindowUtils::HasStyle(style, WS_THICKFRAME);
|
||||
bool hasCaption = FancyZonesWindowUtils::HasStyle(style, WS_CAPTION);
|
||||
if (isPopup && !(hasThickFrame && hasCaption))
|
||||
bool hasCaption = FancyZonesWindowUtils::HasStyle(style, WS_CAPTION);
|
||||
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 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.
|
||||
return ProcessabilityType::NonProcessablePopupWindow;
|
||||
}
|
||||
|
||||
@@ -118,6 +118,14 @@ namespace FancyZonesUnitTests
|
||||
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)
|
||||
{
|
||||
FancyZonesSettings::instance().SetSettings(Settings{ .allowSnapChildWindows = false });
|
||||
|
||||
Reference in New Issue
Block a user