[vlc-commits] macosx: delay start in fullscreen animation to allow to finish resize animation before (close #8780)
David Fuhrmann
git at videolan.org
Thu Jun 20 21:53:07 CEST 2013
vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Thu Jun 20 20:53:18 2013 +0200| [056a2b9a08b01403b0111797372a042abab33953] | committer: David Fuhrmann
macosx: delay start in fullscreen animation to allow to finish resize animation before (close #8780)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=056a2b9a08b01403b0111797372a042abab33953
---
modules/gui/macosx/VLCVoutWindowController.m | 30 +++++++++++++++++++++++++-
modules/gui/macosx/intf.m | 19 ----------------
2 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index ff90a19..0bd56d3 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -148,9 +148,37 @@
}
}
+ NSSize videoViewSize = NSMakeSize(videoViewPosition.size.width, videoViewPosition.size.height);
+
+ // TODO: find a cleaner way for "start in fullscreen"
+ // Start in fs, because either prefs settings, or fullscreen button was pressed before
+ if (var_InheritBool(VLCIntf, "fullscreen") || var_GetBool(pl_Get(VLCIntf), "fullscreen")) {
+
+ // this is not set when we start in fullscreen because of
+ // fullscreen settings in video prefs the second time
+ var_SetBool(p_wnd->p_parent, "fullscreen", 1);
+
+ int i_full = 1;
+
+ SEL sel = @selector(setFullscreen:forWindow:);
+ NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:sel]];
+ [inv setTarget:self];
+ [inv setSelector:sel];
+ [inv setArgument:&i_full atIndex:2];
+ [inv setArgument:&p_wnd atIndex:3];
+
+ NSTimeInterval resizeTime = 0.;
+ if(!b_nonembedded && !b_video_wallpaper) {
+ NSRect window_rect = [o_new_video_window getWindowRectForProposedVideoViewSize:videoViewSize];
+ resizeTime = [o_new_video_window animationResizeTime:window_rect];
+ resizeTime += 0.1;
+ }
+
+ [NSTimer scheduledTimerWithTimeInterval:resizeTime invocation:inv repeats:NO];
+ }
+
if (!b_video_wallpaper) {
// set window size
- NSSize videoViewSize = NSMakeSize(videoViewPosition.size.width, videoViewPosition.size.height);
if (b_nonembedded) {
NSRect window_rect = [o_new_video_window getWindowRectForProposedVideoViewSize:videoViewSize];
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 9ecdcf8..179aafb 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -178,25 +178,6 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
msg_Dbg(VLCIntf, "returning videoview with proposed position x=%i, y=%i, width=%i, height=%i", cfg->x, cfg->y, cfg->width, cfg->height);
p_wnd->handle.nsobject = videoView;
- // TODO: find a cleaner way for "start in fullscreen"
- // either prefs settings, or fullscreen button was pressed before
- if (var_InheritBool(VLCIntf, "fullscreen") || var_GetBool(pl_Get(VLCIntf), "fullscreen")) {
-
- // this is not set when we start in fullscreen because of
- // fullscreen settings in video prefs the second time
- var_SetBool(p_wnd->p_parent, "fullscreen", 1);
-
- int i_full = 1;
-
- SEL sel = @selector(setFullscreen:forWindow:);
- NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[o_vout_controller methodSignatureForSelector:sel]];
- [inv setTarget:o_vout_controller];
- [inv setSelector:sel];
- [inv setArgument:&i_full atIndex:2];
- [inv setArgument:&p_wnd atIndex:3];
- [inv performSelectorOnMainThread:@selector(invoke) withObject:nil
- waitUntilDone:NO];
- }
[o_vout_provider_lock unlock];
[[VLCMain sharedInstance] setActiveVideoPlayback: YES];
More information about the vlc-commits
mailing list