[vlc-devel] commit: macosx: Attempt to really fix window look. (Pierre d'Herbemont )

Georg Seifert georg.seifert at gmx.de
Tue Aug 26 08:29:47 CEST 2008


Hello,

With the help of the cocoa dev list I found the possible fix to the  
problem:

as its described here:
http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/HowItWorks/chapter_2_section_3.html

you need to set the the "Base SDK" to 10.5 (in the Project Info >  
General) and the "deployment SDK" to 10.4. (in Project Info > Build >  
Deployment Target)
(There is also a link to docs about setting this in makefile)

I didn’t test this in Tiger but it is exactly what the docs say so it  
should not break anything.

With this you can use this:

- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned  
int)windowStyle backing:(NSBackingStoreType)bufferingType defer: 
(BOOL)deferCreation {
	BOOL useTextured = YES;
    if(![[NSWindow class]  
instancesRespondToSelector 
:@selector(setContentBorderThickness:forEdge:)])
	{
		useTextured = NO;
		windowStyle ^= NSTexturedBackgroundWindowMask;
	}
	self = [super initWithContentRect:contentRect styleMask:windowStyle  
backing:bufferingType defer:deferCreation];
    if(!useTextured)
	{
		[self setContentBorderThickness:32.0 forEdge:NSMinYEdge];
	}
	return self;
}

I hope this works.
Georg

> vlc | branch: 0.9-bugfix | Pierre d'Herbemont <pdherbemont at videolan.org 
> > | Tue Aug 26 00:55:23 2008 +0200|  
> [111f8992fa1cf9da7ff18bfaf7287b89661cb396] | committer: Pierre  
> d'Herbemont
>
> macosx: Attempt to really fix window look.
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=111f8992fa1cf9da7ff18bfaf7287b89661cb396
> ---
>
> modules/gui/macosx/embeddedwindow.m |   29 ++++++++ 
> +--------------------
> 1 files changed, 9 insertions(+), 20 deletions(-)
>
> diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/ 
> macosx/embeddedwindow.m
> index 318f684..e5f09b5 100644
> --- a/modules/gui/macosx/embeddedwindow.m
> +++ b/modules/gui/macosx/embeddedwindow.m
> @@ -44,26 +44,15 @@
> - (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned  
> int)windowStyle backing:(NSBackingStoreType)bufferingType defer: 
> (BOOL)deferCreation
> {
>    if(MACOS_VERSION < 10.5f)
> -    {
> -        self = [super initWithContentRect:contentRect  
> styleMask:windowStyle backing:bufferingType defer:deferCreation];
> -    } else {
> -        SEL theSelector;
> -        NSMethodSignature *aSignature;
> -        NSInvocation *anInvocation;
> -        float f_value = 32.0f;
> -        NSRectEdge ouredge = NSMinYEdge;
> -
> -        windowStyle ^= NSTexturedBackgroundWindowMask;
> -        self = [super initWithContentRect:contentRect  
> styleMask:windowStyle backing:bufferingType defer:deferCreation];
> -
> -        theSelector = @selector(setContentBorderThickness:forEdge:);
> -        aSignature = [VLCEmbeddedWindow  
> instanceMethodSignatureForSelector:theSelector];
> -        anInvocation = [NSInvocation  
> invocationWithMethodSignature:aSignature];
> -        [anInvocation setSelector:theSelector];
> -        [anInvocation setTarget:self];
> -        [anInvocation setArgument:&f_value atIndex:2]; /* FIXME  
> it's actually CGFLoat */
> -        [anInvocation setArgument:&ouredge atIndex:3];
> -    }
> +        return [super initWithContentRect:contentRect  
> styleMask:windowStyle backing:bufferingType defer:deferCreation];
> +
> +#ifdef __ppc__
> +    return [super initWithContentRect:contentRect  
> styleMask:windowStyle backing:bufferingType defer:deferCreation];
> +#endif
> +
> +    windowStyle ^= NSTexturedBackgroundWindowMask;
> +    self = [super initWithContentRect:contentRect  
> styleMask:windowStyle backing:bufferingType defer:deferCreation];
> +    [self setContentBorderThickness:32.0 forEdge:NSMinYEdge];
>    return self;
> }
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel




More information about the vlc-devel mailing list