From 029788c7e24d83624756e82cbbb7c93d6f72ebfb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 6 Feb 2014 08:57:53 +0100 Subject: [PATCH] * nsterm.m (toggleFullScreen:): Hide menubar on secondary monitor for OSX >= 10.9 if separate spaces are used. (toggleFullScreen:): Use screen of w instead of fw. Fixes: debbugs:16659 --- src/ChangeLog | 6 ++++++ src/nsterm.m | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 925cb4625a2..8a7dfae4864 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-02-06 Jan Djärv + + * nsterm.m (toggleFullScreen:): Hide menubar on secondary monitor + for OSX >= 10.9 if separate spaces are used. + (toggleFullScreen:): Use screen of w instead of fw (Bug#16659). + 2014-02-06 Glenn Morris * buffer.c (cache-long-scans): Doc fix. diff --git a/src/nsterm.m b/src/nsterm.m index 34e9320af95..8bb806e47c8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6396,6 +6396,14 @@ if (cols > 0 && rows > 0) if (fs_state != FULLSCREEN_BOTH) { + NSScreen *screen = [w screen]; + +#if defined (NS_IMPL_COCOA) && \ + MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 + /* Hide ghost menu bar on secondary monitor? */ + if (! onFirstScreen) + onFirstScreen = [NSScreen screensHaveSeparateSpaces]; +#endif /* Hide dock and menubar if we are on the primary screen. */ if (onFirstScreen) { @@ -6416,7 +6424,7 @@ if (cols > 0 && rows > 0) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES - screen:[w screen]]; + screen:screen]; [fw setContentView:[w contentView]]; [fw setTitle:[w title]]; @@ -6439,7 +6447,7 @@ if (cols > 0 && rows > 0) [fw makeKeyAndOrderFront:NSApp]; [fw makeFirstResponder:self]; [w orderOut:self]; - r = [fw frameRectForContentRect:[[fw screen] frame]]; + r = [fw frameRectForContentRect:[screen frame]]; [fw setFrame: r display:YES animate:YES]; [self windowDidEnterFullScreen:nil]; [fw display]; -- 2.39.2