Commit 843cea2c authored by Felix Paul Kühne's avatar Felix Paul Kühne

windowed mac plugin: merge NSScreen additions from the minimal macosx module

parent 87590128
......@@ -9,6 +9,7 @@
* Jean-Baptiste Kempf <jb@videolan.org>
* James Bates <james.h.bates@gmail.com>
* Pierre d'Herbemont <pdherbemont # videolan.org>
* David Fuhrmann <david dot fuhrmann at googlemail dot com>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -99,6 +100,12 @@
@end
@interface NSScreen (VLCAdditions)
- (BOOL)hasMenuBar;
- (BOOL)hasDock;
- (CGDirectDisplayID)displayID;
@end
static CALayer * rootLayer;
static VLCPlaybackLayer * playbackLayer;
static VLCNoMediaLayer * noMediaLayer;
......@@ -736,6 +743,35 @@ static CGImageRef createImageNamed(NSString *name)
@end
@implementation NSScreen (VLCAdditions)
- (BOOL)hasMenuBar
{
return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]);
}
- (BOOL)hasDock
{
NSRect screen_frame = [self frame];
NSRect screen_visible_frame = [self visibleFrame];
CGFloat f_menu_bar_thickness = [self hasMenuBar] ? [[NSStatusBar systemStatusBar] thickness] : 0.0;
BOOL b_found_dock = NO;
if (screen_visible_frame.size.width < screen_frame.size.width)
b_found_dock = YES;
else if (screen_visible_frame.size.height + f_menu_bar_thickness < screen_frame.size.height)
b_found_dock = YES;
return b_found_dock;
}
- (CGDirectDisplayID)displayID
{
return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];
}
@end
@implementation VLCFullscreenWindow
- (id)initWithContentRect:(NSRect)contentRect
......
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