Commit 498f15b3 authored by Felix Paul Kühne's avatar Felix Paul Kühne

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
parent 0e608f94
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#import <vlc_input.h> #import <vlc_input.h>
#import "misc.h" #import "misc.h"
#import "fspanel.h" #import "fspanel.h"
#import "MainWindowTitle.h"
@interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate, NSSplitViewDelegate> { @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate, NSSplitViewDelegate> {
IBOutlet id o_play_btn; IBOutlet id o_play_btn;
...@@ -112,6 +113,7 @@ ...@@ -112,6 +113,7 @@
NSTimer *t_hide_mouse_timer; NSTimer *t_hide_mouse_timer;
VLCColorView * o_color_backdrop;
NSInteger i_originalLevel; NSInteger i_originalLevel;
NSRect previousSavedFrame; NSRect previousSavedFrame;
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#import "open.h" #import "open.h"
#import "controls.h" // TODO: remove me #import "controls.h" // TODO: remove me
#import "SideBarItem.h" #import "SideBarItem.h"
#import "MainWindowTitle.h"
#import <vlc_playlist.h> #import <vlc_playlist.h>
#import <vlc_aout_intf.h> #import <vlc_aout_intf.h>
#import <vlc_url.h> #import <vlc_url.h>
...@@ -109,6 +108,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -109,6 +108,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)dealloc - (void)dealloc
{ {
if (b_dark_interface)
[o_color_backdrop release];
[[NSNotificationCenter defaultCenter] removeObserver: self]; [[NSNotificationCenter defaultCenter] removeObserver: self];
config_PutInt( VLCIntf->p_libvlc, "volume", i_lastShownVolume ); config_PutInt( VLCIntf->p_libvlc, "volume", i_lastShownVolume );
[self saveFrameUsingName: [self frameAutosaveName]]; [self saveFrameUsingName: [self frameAutosaveName]];
...@@ -424,6 +426,10 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -424,6 +426,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_video_view setFrame: winrect]; [o_video_view setFrame: winrect];
previousSavedFrame = 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]; [self display];
} }
else else
......
/***************************************************************************** /*****************************************************************************
* MainWindowTitle.h: MacOS X interface module * MainWindowTitle.h: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2011 Felix Paul Kühne * Copyright (C) 2011-2012 Felix Paul Kühne
* $Id$ * $Id$
* *
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org> * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
...@@ -64,5 +64,9 @@ ...@@ -64,5 +64,9 @@
@interface VLCResizeControl : NSImageView @interface VLCResizeControl : NSImageView
{ {
} }
@end
@interface VLCColorView : NSView
{
}
@end @end
/***************************************************************************** /*****************************************************************************
* MainWindowTitle.m: MacOS X interface module * MainWindowTitle.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2011 Felix Paul Kühne * Copyright (C) 2011-2012 Felix Paul Kühne
* $Id$ * $Id$
* *
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org> * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
...@@ -272,3 +272,19 @@ ...@@ -272,3 +272,19 @@
} }
@end @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; ...@@ -133,6 +133,8 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
if (OSX_LION) if (OSX_LION)
[o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary]; [o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
else
[o_intf_nativefullscreen_ckb setEnabled:NO];
#ifndef MAC_OS_X_VERSION_10_7 #ifndef MAC_OS_X_VERSION_10_7
[o_intf_nativefullscreen_ckb setEnabled:NO]; [o_intf_nativefullscreen_ckb setEnabled:NO];
#endif #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