Refactor common and fancyzones/utils (#6073)

* Move module-specific functions to module

* Refactor FZ utils

* Remove 'zonable' from FancyZonesWindowInfo

* Address PR comments

* Address PR comments

* Fix stuff after rebasing
This commit is contained in:
stefansjfw
2020-08-24 19:38:15 +02:00
committed by GitHub
parent 2817bf4d62
commit 9999a2b126
12 changed files with 705 additions and 690 deletions

View File

@@ -13,24 +13,8 @@ std::optional<RECT> get_button_pos(HWND hwnd);
std::optional<RECT> get_window_pos(HWND hwnd);
// Gets mouse position.
std::optional<POINT> get_mouse_pos();
// Test if window can be zoned by FancyZones
struct FancyZonesFilter
{
bool zonable = false; // If the window is zonable by FancyZones by default - true when both standard_window and no_visible_owner are also true
bool standard_window = false; // True if from the styles the window looks like a standard window
bool no_visible_owner = false; // True if the window is a top-level window that does not have a visible owner
std::wstring process_path; // Path to the executable owning the window
};
FancyZonesFilter get_fancyzones_filtered_window(HWND window);
// Gets active foreground window, filtering out all "non standard" windows like the taskbar, etc.
struct ShortcutGuideFilter
{
HWND hwnd = nullptr; // Handle to the top-level foreground window or nullptr if there is no such window
bool snappable = false; // True, if the window can react to Windows Snap keys
};
ShortcutGuideFilter get_shortcutguide_filtered_window();
// Check if window is part of the shell or the taskbar.
bool is_system_window(HWND hwnd, const char* class_name);
// Calculate sizes
int width(const RECT& rect);