1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2012 VLC authors and VideoLAN
7 * Authors: Felix Paul Kühne <fkuehne at videolan dot org>
8 * David Fuhrmann <david dot fuhrmann at googlemail dot com>
9 * Pierre d'Herbemont <pdherbemont # videolan dot org>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
28 @implementation NSScreen (VLCAdditions)
32 return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]);
37 NSRect screen_frame = [self frame];
38 NSRect screen_visible_frame = [self visibleFrame];
39 CGFloat f_menu_bar_thickness = [self hasMenuBar] ? [[NSStatusBar systemStatusBar] thickness] : 0.0;
41 BOOL b_found_dock = NO;
42 if (screen_visible_frame.size.width < screen_frame.size.width)
44 else if (screen_visible_frame.size.height + f_menu_bar_thickness < screen_frame.size.height)
50 - (CGDirectDisplayID)displayID
52 return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];