Skip to content

Commit

Permalink
FancyZones: filter out WM_POPUP windows if they dont have maximize/mi…
Browse files Browse the repository at this point in the history
…nimize button or a sizable frame (microsoft#1212)

This filters out TaskView and Win32 menus.
  • Loading branch information
bzoz authored and udit3333 committed Feb 19, 2020
1 parent cb58f08 commit b1f5714
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common/hwnd_data_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ bool HWNDDataCache::is_invalid_class(HWND hwnd) const {
}
bool HWNDDataCache::is_invalid_style(HWND hwnd) const {
auto style = GetWindowLong(hwnd, GWL_STYLE);
// WS_POPUP need to have a border or minimize/maximize buttons,
// otherwise the window is "not interesting"
if ((style & WS_POPUP) == WS_POPUP &&
(style & WS_THICKFRAME) == 0 &&
(style & WS_MINIMIZEBOX) == 0 &&
(style & WS_MAXIMIZEBOX) == 0) {
return true;
}
for (auto invalid : invalid_basic_styles) {
if ((invalid & style) != 0) {
return true;
Expand Down

0 comments on commit b1f5714

Please sign in to comment.