[vlc-commits] vout_macosx: check whether the receiving window can respond to non-standard calls prior to calling them (close #6034)

Felix Paul Kühne git at videolan.org
Mon Mar 26 20:52:11 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Mar 25 23:14:38 2012 +0200| [90237c303c4c6f4a2f80f57e330da72d661b7d9a] | committer: Felix Paul Kühne

vout_macosx: check whether the receiving window can respond to non-standard calls prior to calling them (close #6034)
(cherry picked from commit fe53c6cd32682d52f740bc49767c5eab68632e51)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=90237c303c4c6f4a2f80f57e330da72d661b7d9a
---

 modules/video_output/macosx.m |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 576ed7f..131b209 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -315,9 +315,15 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_FULLSCREEN:
         {
             NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
-            [[sys->glView window] performSelectorOnMainThread:@selector(updateFullscreen) withObject: nil waitUntilDone:NO];
+            id window = [sys->glView window];
+            if ([window respondsToSelector:@selector(updateFullscreen)])
+            {
+                [[sys->glView window] performSelectorOnMainThread:@selector(updateFullscreen) withObject: nil waitUntilDone:NO];
+                [o_pool release];
+                return VLC_SUCCESS;
+            }
             [o_pool release];
-            return VLC_SUCCESS;
+            return VLC_EGENERIC;
         }
         case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
         {
@@ -560,11 +566,16 @@ static void OpenglSwap(vlc_gl_t *gl)
  */
 - (void)setWindowFrameWithValue:(NSValue *)value
 {
-    if (![[self window] isFullscreen])
+    id window = [self window];
+    NSRect frame = [value rectValue];
+
+    if ([window respondsToSelector:@selector(isFullscreen)])
     {
-        NSRect frame = [value rectValue];
-        [[self window] setFrame:frame display:YES animate: YES];
+        if (!(BOOL)[[self window] isFullscreen])
+            [[self window] setFrame:frame display:YES animate:YES];
     }
+    else
+        [[self window] setFrame:frame display:YES animate:YES];
 }
 
 /**



More information about the vlc-commits mailing list