winemac: Consider minimized windows as "on screen" for our purposes.

This commit is contained in:
Ken Thomases 2013-05-16 18:43:25 -05:00 committed by Alexandre Julliard
parent c3183fc007
commit 6d4098ebd3
1 changed files with 12 additions and 7 deletions

View File

@ -573,6 +573,11 @@ - (void) setWindowFeatures:(const struct macdrv_window_features*)wf
[self setHasShadow:wf->shadow];
}
- (BOOL) isOrderedIn
{
return [self isVisible] || [self isMiniaturized];
}
- (void) adjustWindowLevel
{
WineApplicationController* controller = [WineApplicationController sharedController];
@ -619,14 +624,14 @@ - (void) adjustWindowLevel
Also, any windows which are supposed to be in front of it had
better have the same or higher window level. If not, bump them
up. */
if (index != NSNotFound && [self isVisible])
if (index != NSNotFound && [self isOrderedIn])
{
for (; index > 0; index--)
{
other = [[controller orderedWineWindows] objectAtIndex:index - 1];
if ([other level] < level)
[other setLevelWhenActive:level];
else
else if ([self isVisible])
{
[self orderWindow:NSWindowBelow relativeTo:[other windowNumber]];
break;
@ -654,13 +659,13 @@ - (void) setMacDrvState:(const struct macdrv_window_state*)state
if (state->excluded_by_cycle)
{
behavior |= NSWindowCollectionBehaviorIgnoresCycle;
if ([self isVisible])
if ([self isOrderedIn])
[NSApp removeWindowsItem:self];
}
else
{
behavior |= NSWindowCollectionBehaviorParticipatesInCycle;
if ([self isVisible])
if ([self isOrderedIn])
[NSApp addWindowsItem:self title:[self title] filename:NO];
}
[self setCollectionBehavior:behavior];
@ -756,7 +761,7 @@ - (void) doOrderOut
- (BOOL) setFrameIfOnScreen:(NSRect)contentRect
{
NSArray* screens = [NSScreen screens];
BOOL on_screen = [self isVisible];
BOOL on_screen = [self isOrderedIn];
NSRect frame, oldFrame;
if (![screens count]) return on_screen;
@ -892,7 +897,7 @@ - (void) makeFocused:(BOOL)activate
/* If a borderless window is offscreen, orderFront: won't move
it onscreen like it would for a titled window. Do that ourselves. */
screens = [NSScreen screens];
if (!([self styleMask] & NSTitledWindowMask) && ![self isVisible] &&
if (!([self styleMask] & NSTitledWindowMask) && ![self isOrderedIn] &&
!frame_intersects_screens([self frame], screens))
{
NSScreen* primaryScreen = [screens objectAtIndex:0];
@ -1482,7 +1487,7 @@ void macdrv_set_cocoa_window_title(macdrv_window w, const unsigned short* title,
titleString = @"";
OnMainThreadAsync(^{
[window setTitle:titleString];
if ([window isVisible] && ![window isExcludedFromWindowsMenu])
if ([window isOrderedIn] && ![window isExcludedFromWindowsMenu])
[NSApp changeWindowsItem:window title:titleString filename:NO];
});