winemac: Allow zero-sized windows to be selected from the Mac Window menu.

They show up in the taskbar on Windows 7.  Selecting them from there is
meaningful and useful, as is selecting them from the Window menu.

In addition to just switching among windows from that menu, this is also
important to recovering a minimized window if the user has configured their
system preferences to minimize windows into the process's dock icon (rather
than as separate dock icons).
This commit is contained in:
Ken Thomases 2013-10-04 00:17:17 -05:00 committed by Alexandre Julliard
parent 13e3219c2f
commit 63fe00eae7
1 changed files with 2 additions and 3 deletions

View File

@ -89,13 +89,11 @@ static void get_cocoa_window_features(struct macdrv_win_data *data,
static inline BOOL can_activate_window(HWND hwnd)
{
LONG style = GetWindowLongW(hwnd, GWL_STYLE);
RECT rect;
if (!(style & WS_VISIBLE)) return FALSE;
if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_NOACTIVATE) return FALSE;
if (hwnd == GetDesktopWindow()) return FALSE;
if (GetWindowRect(hwnd, &rect) && IsRectEmpty(&rect)) return FALSE;
return !(style & WS_DISABLED);
}
@ -112,9 +110,10 @@ static void get_cocoa_window_state(struct macdrv_win_data *data,
state->no_activate = !can_activate_window(data->hwnd);
state->floating = (ex_style & WS_EX_TOPMOST) != 0;
state->excluded_by_expose = state->excluded_by_cycle =
IsRectEmpty(&data->window_rect) ||
(!(ex_style & WS_EX_APPWINDOW) &&
(GetWindow(data->hwnd, GW_OWNER) || (ex_style & (WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE))));
if (IsRectEmpty(&data->window_rect))
state->excluded_by_expose = TRUE;
state->minimized = (style & WS_MINIMIZE) != 0;
}