diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-28 08:28:01 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-28 09:08:08 +0100 |
commit | e4d23dd01d68e2ef0f0ffd4f49277afb15432208 (patch) | |
tree | eced807dfc116ec0099ac235da624b58a89c2797 /video/out/cocoa/window.m | |
parent | 5e9c226229087cb6b594795e1c83dc6efb105a31 (diff) | |
download | mpv-e4d23dd01d68e2ef0f0ffd4f49277afb15432208.tar.bz2 mpv-e4d23dd01d68e2ef0f0ffd4f49277afb15432208.tar.xz |
cocoa: apply the more invasive constraining only with cmd+1/2/3
Regression from bc49957
Fixes #321
Diffstat (limited to 'video/out/cocoa/window.m')
-rw-r--r-- | video/out/cocoa/window.m | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m index e474292324..97f5af1dd9 100644 --- a/video/out/cocoa/window.m +++ b/video/out/cocoa/window.m @@ -31,6 +31,7 @@ @implementation MpvVideoWindow { NSSize _queued_video_size; bool _fs_resize_scheduled; + bool _recenter_window_during_constraint; } @synthesize adapter = _adapter; @@ -117,6 +118,7 @@ CGFloat dx = (f.size.width - ns.width) / 2; CGFloat dy = (f.size.height - ns.height - [self titleHeight]) / 2; NSRect nf = NSRectFromCGRect(CGRectInset(NSRectToCGRect(f), dx, dy)); + self->_recenter_window_during_constraint = true; [self setFrame:nf display:NO animate:NO]; } @@ -124,13 +126,19 @@ { NSRect s = [[self screen] visibleFrame]; if (nf.origin.y + nf.size.height > s.origin.y + s.size.height) { - nf.size.height = s.size.height; + if (self->_recenter_window_during_constraint) + nf.size.height = s.size.height; nf.origin.y = s.origin.y + s.size.height - nf.size.height; } - return nf; } +- (void)setFrame:(NSRect)frame display:(BOOL)display animate:(BOOL)animate +{ + [super setFrame:frame display:display animate:animate]; + self->_recenter_window_during_constraint = false; +} + - (void)queueNewVideoSize:(NSSize)new_size { NSSize prev_size = self->_queued_video_size; |