]> git.sesse.net Git - vlc/commitdiff
macosx: prevent ugly rendering artifacts when resizing the black main window on a...
authorFelix Paul Kühne <fkuehne@videolan.org>
Wed, 11 Jan 2012 20:40:38 +0000 (21:40 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Wed, 11 Jan 2012 20:40:38 +0000 (21:40 +0100)
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindowTitle.h
modules/gui/macosx/MainWindowTitle.m
modules/gui/macosx/simple_prefs.m

index 44b243861283a16ed06b120be931d262ea91f84a..5ed83249a0a121ff5546f9682f6fc60513fab16c 100644 (file)
@@ -30,6 +30,7 @@
 #import <vlc_input.h>
 #import "misc.h"
 #import "fspanel.h"
+#import "MainWindowTitle.h"
 
 @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate, NSSplitViewDelegate> {
     IBOutlet id o_play_btn;
 
     NSTimer *t_hide_mouse_timer;
 
+    VLCColorView * o_color_backdrop;
     NSInteger i_originalLevel;
     NSRect previousSavedFrame;
 }
index 186392d98cdff310dc3f99dceb22c6d0bf0eb43d..ea804c267125a0dfbac62001695fe9c9282f69cd 100644 (file)
@@ -33,7 +33,6 @@
 #import "open.h"
 #import "controls.h" // TODO: remove me
 #import "SideBarItem.h"
-#import "MainWindowTitle.h"
 #import <vlc_playlist.h>
 #import <vlc_aout_intf.h>
 #import <vlc_url.h>
@@ -109,6 +108,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)dealloc
 {
+    if (b_dark_interface)
+        [o_color_backdrop release];
+
     [[NSNotificationCenter defaultCenter] removeObserver: self];
     config_PutInt( VLCIntf->p_libvlc, "volume", i_lastShownVolume );
     [self saveFrameUsingName: [self frameAutosaveName]];
@@ -424,6 +426,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [o_video_view setFrame: winrect];
         previousSavedFrame = winrect;
 
+        o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view frame]];
+        [[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_split_view];
+        [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
+
         [self display];
     }
     else
index ecbdd3e5c9ad8b4842b68adbfd043f892a1e1f4c..718085060f0bc707e5a9447f76f4acbb8659d549 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * MainWindowTitle.h: MacOS X interface module
  *****************************************************************************
- * Copyright (C) 2011 Felix Paul Kühne
+ * Copyright (C) 2011-2012 Felix Paul Kühne
  * $Id$
  *
  * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
@@ -64,5 +64,9 @@
 @interface VLCResizeControl : NSImageView
 {
 }
+@end
 
+@interface VLCColorView : NSView
+{
+}
 @end
index 9b883d0bd1b085276879f67d1542b83abd0d874e..d8800dfe9ac956382cea144e419f218b22986491 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * MainWindowTitle.m: MacOS X interface module
  *****************************************************************************
- * Copyright (C) 2011 Felix Paul Kühne
+ * Copyright (C) 2011-2012 Felix Paul Kühne
  * $Id$
  *
  * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
 }
 
 @end
+
+/*****************************************************************************
+ * VLCColorView
+ *
+ * since we are using a clear window color when using the black window 
+ * style, some filling is needed behind the video and some other elements
+ *****************************************************************************/
+
+@implementation VLCColorView
+
+- (void)drawRect:(NSRect)rect {
+    [[NSColor blackColor] setFill];
+    NSRectFill(rect);
+}
+
+@end
index 02af0a034b7e73a3b08e5257603e8297e5f3ff0c..3513f322e812b5d6fabb56a4e80ec2d693a7c4d9 100644 (file)
@@ -133,6 +133,8 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 
     if (OSX_LION)
         [o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
+    else
+        [o_intf_nativefullscreen_ckb setEnabled:NO];
 #ifndef MAC_OS_X_VERSION_10_7
     [o_intf_nativefullscreen_ckb setEnabled:NO];
 #endif