[vlc-commits] macosx: clean up

Felix Paul Kühne git at videolan.org
Sun Sep 4 19:44:00 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Sep  4 19:43:50 2011 +0200| [1a54bf7cd05c3ed6dab91593399f58bd8821adbc] | committer: Felix Paul Kühne

macosx: clean up

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a54bf7cd05c3ed6dab91593399f58bd8821adbc
---

 modules/gui/macosx/CompatibilityFixes.h |    5 +++++
 modules/gui/macosx/MainWindow.m         |    2 +-
 modules/gui/macosx/VideoView.m          |    5 +----
 modules/gui/macosx/controls.m           |    2 +-
 modules/gui/macosx/misc.m               |    2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
index 1860c36..08198e2 100644
--- a/modules/gui/macosx/CompatibilityFixes.h
+++ b/modules/gui/macosx/CompatibilityFixes.h
@@ -56,6 +56,11 @@ enum {
     NSApplicationPresentationDisableHideApplication     = (1 <<  8),
     NSApplicationPresentationDisableMenuBarTransparency = (1 <<  9)
 };
+
+ at interface NSWindow (IntroducedInLion) // just to shut off warnings, not implemented!
+- (void)setRestorable:(BOOL);
+ at end
+
 #endif
 
 #pragma mark -
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 0b8d3a2..68c8260 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -80,7 +80,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [self setMovableByWindowBackground: YES];
 
     /* we don't want this window to be restored on relaunch */
-    if ([self respondsToSelector:@selector(setRestorable:)])
+    if (OSX_LION)
         [self setRestorable:NO];
 
     return self;
diff --git a/modules/gui/macosx/VideoView.m b/modules/gui/macosx/VideoView.m
index 705a8f9..ea702a2 100644
--- a/modules/gui/macosx/VideoView.m
+++ b/modules/gui/macosx/VideoView.m
@@ -397,10 +397,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
 - (void)renewGState
 {
-    NSWindow *window = [self window];
-
-	if ([window respondsToSelector:@selector(disableScreenUpdatesUntilFlush)])
-		[window disableScreenUpdatesUntilFlush];
+    [[self window] disableScreenUpdatesUntilFlush];
 
     [super renewGState];
 }
diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m
index e147ed6..0ad95d8 100644
--- a/modules/gui/macosx/controls.m
+++ b/modules/gui/macosx/controls.m
@@ -252,7 +252,7 @@
 {
     intf_thread_t * p_intf = VLCIntf;
     BOOL b_invertedEventFromDevice = NO;
-    if ([theEvent respondsToSelector:@selector(isDirectionInvertedFromDevice)])
+    if (OSX_LION)
     {
         if ([theEvent isDirectionInvertedFromDevice])
             b_invertedEventFromDevice = YES;
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 1d50068..df621ed 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -190,7 +190,7 @@ static NSMutableArray *blackoutWindows = NULL;
     {
         b_isset_canBecomeKeyWindow = NO;
         /* we don't want this window to be restored on relaunch */
-        if ([self respondsToSelector:@selector(setRestorable:)])
+        if (OSX_LION)
             [self setRestorable:NO];
     }
     return self;



More information about the vlc-commits mailing list