Commit b8da8fa4 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Ignore Cocoa child windows which aren't instances of WineWindow.

On Yosemite, in full-screen mode, Cocoa adds child windows of its own to our windows. These windows are, of course, not instances of WineWindow. So, when we call WineWindow-specific methods on them, it throws exceptions.
parent b2ef8775
......@@ -195,6 +195,8 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
@property (retain, nonatomic) NSTimer* liveResizeDisplayTimer;
@property (readonly, copy, nonatomic) NSArray* childWineWindows;
- (void) updateColorSpace;
- (BOOL) becameEligibleParentOrChild;
......@@ -834,7 +836,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
// Became non-floating. If parent of floating children, make that
// relationship latent.
WineWindow* child;
for (child in [[[self childWindows] copy] autorelease])
for (child in [self childWineWindows])
{
if (child.floating)
[child becameIneligibleChild];
......@@ -1012,7 +1014,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
- (void) becameIneligibleParentOrChild
{
NSArray* childWindows = [self childWindows];
NSArray* childWindows = [self childWineWindows];
[self becameIneligibleChild];
......@@ -1020,7 +1022,6 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
{
WineWindow* child;
childWindows = [[childWindows copy] autorelease];
for (child in childWindows)
{
child.latentParentWindow = self;
......@@ -1101,7 +1102,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
// Get our child windows and sort them in the reverse of the desired
// z-order (back-to-front).
origChildren = [self childWindows];
origChildren = [self childWineWindows];
children = [[origChildren mutableCopy] autorelease];
[children sortWithOptions:NSSortStable
usingComparator:^NSComparisonResult(id obj1, id obj2){
......@@ -1315,7 +1316,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
[self setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
}
if (equalSizes && [[self childWindows] count])
if (equalSizes && [[self childWineWindows] count])
{
// If we change the window frame such that the origin moves
// but the size doesn't change, then Cocoa moves child
......@@ -1611,6 +1612,15 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
[super toggleFullScreen:sender];
}
- (NSArray*) childWineWindows
{
NSArray* childWindows = self.childWindows;
NSIndexSet* indexes = [childWindows indexesOfObjectsPassingTest:^BOOL(id child, NSUInteger idx, BOOL *stop){
return [child isKindOfClass:[WineWindow class]];
}];
return [childWindows objectsAtIndexes:indexes];
}
// We normally use the generic/calibrated RGB color space for the window,
// rather than the device color space, to avoid expensive color conversion
// which slows down drawing. However, for windows displaying OpenGL, having
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment