Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FancyZones] Popup behavior fix (#18270)
* virtual desktop check * refactoring * unified check
- Loading branch information
1 parent
be1ed8c
commit 251ea6d
Showing
6 changed files
with
54 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/modules/fancyzones/FancyZonesLib/FancyZonesWindowProcessing.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include <FancyZonesLib/VirtualDesktop.h> | ||
#include <FancyZonesLib/WindowUtils.h> | ||
|
||
namespace FancyZonesWindowProcessing | ||
{ | ||
inline bool IsProcessable(HWND window) noexcept | ||
{ | ||
const bool isSplashScreen = FancyZonesWindowUtils::IsSplashScreen(window); | ||
if (isSplashScreen) | ||
{ | ||
return false; | ||
} | ||
|
||
const bool windowMinimized = IsIconic(window); | ||
if (windowMinimized) | ||
{ | ||
return false; | ||
} | ||
|
||
// Switch between virtual desktops results with posting same windows messages that also indicate | ||
// creation of new window. We need to check if window being processed is on currently active desktop. | ||
// For windows that FancyZones shouldn't process (start menu, tray, popup menus) | ||
// VirtualDesktopManager is unable to retrieve virtual desktop id and returns an error. | ||
auto desktopId = VirtualDesktop::instance().GetDesktopId(window); | ||
if (!desktopId.has_value() || (desktopId.has_value() && *desktopId != VirtualDesktop::instance().GetCurrentVirtualDesktopId())) | ||
{ | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters