From: Jan Djärv Date: Thu, 6 Feb 2014 07:57:53 +0000 (+0100) Subject: * nsterm.m (toggleFullScreen:): Hide menubar on secondary monitor X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~149 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=029788c7e24d83624756e82cbbb7c93d6f72ebfb;p=emacs.git * 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 --- 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];