[vlc-devel] commit: macosx: updated window styles for VLCControllerWindow and VLCEmbeddedWindow based upon a patch by Georg Seifert ( Felix Paul Kühne )

git version control git at videolan.org
Thu Apr 9 11:22:46 CEST 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Apr  9 11:22:25 2009 +0200| [e2680bfc041b2c224bde9b9b1c4c494388a84793] | committer: Felix Paul Kühne 

macosx: updated window styles for VLCControllerWindow and VLCEmbeddedWindow based upon a patch by Georg Seifert

Some tweaks to the nib file (so VLCControllerWindow looks all textured again) will be submitted later on.

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

 modules/gui/macosx/embeddedwindow.m |   16 ++++++++++++++++
 modules/gui/macosx/misc.m           |   13 ++++++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m
index 0c92c35..8dc0329 100644
--- a/modules/gui/macosx/embeddedwindow.m
+++ b/modules/gui/macosx/embeddedwindow.m
@@ -41,6 +41,22 @@
 
 @implementation VLCEmbeddedWindow
 
+- (id)initWithContentRect:(NSRect)contentRect styleMask: (NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
+{
+    BOOL b_useTextured = YES;
+    if( [[NSWindow class] instancesRespondToSelector:@selector(setContentBorderThickness:forEdge:)] )
+    {
+        b_useTextured = NO;
+        windowStyle ^= NSTexturedBackgroundWindowMask;
+    }
+    self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
+    if(! b_useTextured )
+    {
+        [self setContentBorderThickness:28.0 forEdge:NSMinYEdge];
+    }
+    return self;
+}
+
 - (void)awakeFromNib
 {
     [self setDelegate: self];
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 347148b..fad7b0f 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -406,12 +406,23 @@ static NSMutableArray *blackoutWindows = NULL;
 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
     backing:(NSBackingStoreType)backingType defer:(BOOL)flag
 {
+    BOOL b_useTextured = YES;
+    if( [[NSWindow class] instancesRespondToSelector:@selector(setContentBorderThickness:forEdge:)] )
+    {
+        b_useTextured = NO;
+        styleMask ^= NSTexturedBackgroundWindowMask;
+    }
+
     self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
     backing:backingType defer:flag];
 
     [[VLCMain sharedInstance] updateTogglePlaylistState];
 
-    return( self );
+    if(! b_useTextured )
+    {
+        [self setContentBorderThickness:28.0 forEdge:NSMinYEdge];
+    }
+    return self;
 }
 
 - (BOOL)performKeyEquivalent:(NSEvent *)o_event




More information about the vlc-devel mailing list