winemac: Adjust sizes of all descendant views when Retina mode changes.

As opposed to just the immediate subviews of the window contentView.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2016-05-18 18:38:25 -05:00 committed by Alexandre Julliard
parent 58cc34f4d3
commit 4a76289464
1 changed files with 19 additions and 9 deletions

View File

@ -553,6 +553,24 @@ - (void) wine_setBackingSize:(const int*)newBackingSize
}
}
- (void) setRetinaMode:(int)mode
{
double scale = mode ? 0.5 : 2.0;
NSRect frame = self.frame;
frame.origin.x *= scale;
frame.origin.y *= scale;
frame.size.width *= scale;
frame.size.height *= scale;
[self setFrame:frame];
[self updateGLContexts];
for (WineContentView* subview in [self subviews])
{
if ([subview isKindOfClass:[WineContentView class]])
[subview setRetinaMode:mode];
}
}
- (BOOL) acceptsFirstMouse:(NSEvent*)theEvent
{
return YES;
@ -2301,15 +2319,7 @@ - (void) setRetinaMode:(int)mode
for (WineContentView* subview in [self.contentView subviews])
{
if ([subview isKindOfClass:[WineContentView class]])
{
frame = subview.frame;
frame.origin.x *= scale;
frame.origin.y *= scale;
frame.size.width *= scale;
frame.size.height *= scale;
[subview setFrame:frame];
[subview updateGLContexts];
}
[subview setRetinaMode:mode];
}
frame = [self contentRectForFrameRect:self.wine_fractionalFrame];