[vlc-commits] macosx: set a proper main window frame on termination
David Fuhrmann
git at videolan.org
Sun Jun 29 23:26:08 CEST 2014
vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Jun 22 13:33:35 2014 +0200| [a40fa94e6f12919f3c272dd12cee519744319788] | committer: Jean-Baptiste Kempf
macosx: set a proper main window frame on termination
The frame is used which was set before video playback has been started.
These are the values the user will expect when restarting VLC.
close #11373
(cherry picked from commit b9aee93db573a82adc0160be7e0bf174ffb70dae)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=a40fa94e6f12919f3c272dd12cee519744319788
---
modules/gui/macosx/MainWindow.m | 7 ++++++-
modules/gui/macosx/intf.h | 2 ++
modules/gui/macosx/intf.m | 12 +++++++++---
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 9e74f69..6c96734 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -792,7 +792,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
// only resize back to minimum view of this is still desired final state
CGFloat f_threshold_height = f_min_video_height + [o_controls_bar height];
if(frameBeforePlayback.size.height > f_threshold_height || b_minimized_view) {
- [[self animator] setFrame:frameBeforePlayback display:YES];
+
+ if ([[VLCMain sharedInstance] isTerminating])
+ [self setFrame:frameBeforePlayback display:YES];
+ else
+ [[self animator] setFrame:frameBeforePlayback display:YES];
+
}
}
diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index 91c8fdb..c51094e 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -172,6 +172,8 @@ audio_output_t *getAout(void);
- (void)resetAndReinitializeUserDefaults;
+- (BOOL)isTerminating;
+
@end
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index fcfa057..fefe18d 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -782,14 +782,20 @@ static VLCMain *_o_sharedMainInstance = nil;
[[self playlist] playItem:nil];
}
+/* don't allow a double termination call. If the user has
+ * already invoked the quit then simply return this time. */
+static bool f_appExit = false;
+
#pragma mark -
#pragma mark Termination
+- (BOOL)isTerminating
+{
+ return f_appExit;
+}
+
- (void)applicationWillTerminate:(NSNotification *)notification
{
- /* don't allow a double termination call. If the user has
- * already invoked the quit then simply return this time. */
- static bool f_appExit = false;
bool isTerminating;
[o_appLock lock];
More information about the vlc-commits
mailing list