mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-27 23:19:13 +08:00
[FancyZones]Don't automatically snap context menus (#28956)
* check tabstop * revert * check popup thickframe * Revert "check popup thickframe" * added HasThickFrame * popup check * spellcheck
This commit is contained in:
parent
59fb08cdd8
commit
11f30f9d33
@ -29,6 +29,7 @@
|
|||||||
#include <FancyZonesLib/VirtualDesktop.h>
|
#include <FancyZonesLib/VirtualDesktop.h>
|
||||||
#include <FancyZonesLib/WindowKeyboardSnap.h>
|
#include <FancyZonesLib/WindowKeyboardSnap.h>
|
||||||
#include <FancyZonesLib/WindowMouseSnap.h>
|
#include <FancyZonesLib/WindowMouseSnap.h>
|
||||||
|
#include <FancyZonesLib/WindowUtils.h>
|
||||||
#include <FancyZonesLib/WorkArea.h>
|
#include <FancyZonesLib/WorkArea.h>
|
||||||
#include <FancyZonesLib/WorkAreaConfiguration.h>
|
#include <FancyZonesLib/WorkAreaConfiguration.h>
|
||||||
|
|
||||||
@ -394,6 +395,15 @@ void FancyZones::WindowCreated(HWND window) noexcept
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hotfix
|
||||||
|
// Avoid automatically moving popup windows, as they can be just popup menus.
|
||||||
|
bool isPopup = FancyZonesWindowUtils::IsPopupWindow(window);
|
||||||
|
bool hasThickFrame = FancyZonesWindowUtils::HasThickFrame(window);
|
||||||
|
if (isPopup && !hasThickFrame)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Avoid already stamped (zoned) windows
|
// Avoid already stamped (zoned) windows
|
||||||
const bool isZoned = !FancyZonesWindowProperties::RetrieveZoneIndexProperty(window).empty();
|
const bool isZoned = !FancyZonesWindowProperties::RetrieveZoneIndexProperty(window).empty();
|
||||||
if (isZoned)
|
if (isZoned)
|
||||||
|
@ -192,6 +192,12 @@ bool FancyZonesWindowUtils::IsPopupWindow(HWND window) noexcept
|
|||||||
return ((style & WS_POPUP) == WS_POPUP);
|
return ((style & WS_POPUP) == WS_POPUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FancyZonesWindowUtils::HasThickFrame(HWND window) noexcept
|
||||||
|
{
|
||||||
|
auto style = GetWindowLong(window, GWL_STYLE);
|
||||||
|
return ((style & WS_THICKFRAME) == WS_THICKFRAME);
|
||||||
|
}
|
||||||
|
|
||||||
bool FancyZonesWindowUtils::HasThickFrameAndMinimizeMaximizeButtons(HWND window) noexcept
|
bool FancyZonesWindowUtils::HasThickFrameAndMinimizeMaximizeButtons(HWND window) noexcept
|
||||||
{
|
{
|
||||||
auto style = GetWindowLong(window, GWL_STYLE);
|
auto style = GetWindowLong(window, GWL_STYLE);
|
||||||
|
@ -20,6 +20,7 @@ namespace FancyZonesWindowUtils
|
|||||||
bool HasVisibleOwner(HWND window) noexcept;
|
bool HasVisibleOwner(HWND window) noexcept;
|
||||||
bool IsStandardWindow(HWND window);
|
bool IsStandardWindow(HWND window);
|
||||||
bool IsPopupWindow(HWND window) noexcept;
|
bool IsPopupWindow(HWND window) noexcept;
|
||||||
|
bool HasThickFrame(HWND window) noexcept;
|
||||||
bool HasThickFrameAndMinimizeMaximizeButtons(HWND window) noexcept;
|
bool HasThickFrameAndMinimizeMaximizeButtons(HWND window) noexcept;
|
||||||
bool IsProcessOfWindowElevated(HWND window); // If HWND is already dead, we assume it wasn't elevated
|
bool IsProcessOfWindowElevated(HWND window); // If HWND is already dead, we assume it wasn't elevated
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user