Commit 653c9bca authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Jean-Baptiste Kempf

macosx: prevent ugly rendering artifacts when resizing the black main window...

macosx: prevent ugly rendering artifacts when resizing the black main window on a slow CPU by adding a black backdrop on top of the clear window background
(cherry picked from commit 498f15b3)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2d05710f
......@@ -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;
......@@ -112,6 +113,7 @@
NSTimer *t_hide_mouse_timer;
VLCColorView * o_color_backdrop;
NSInteger i_originalLevel;
NSRect previousSavedFrame;
}
......
......@@ -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
......
/*****************************************************************************
* 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
/*****************************************************************************
* 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>
......@@ -272,3 +272,19 @@
}
@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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment