From aff67c8241806055f8363f924874ab69fe70ed31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 9 Apr 2012 12:01:04 +0200 Subject: [PATCH] * nsterm.m (constrainFrameRect): Always constrain when there is only one screen. Fixes: debbugs:10962 --- src/ChangeLog | 5 +++++ src/nsterm.m | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index af65d38a33b..ef84324c9d9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-04-09 Jan Djärv + + * nsterm.m (constrainFrameRect): Always constrain when there is only + one screen (Bug#10962). + 2012-04-06 Eli Zaretskii * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR): diff --git a/src/nsterm.m b/src/nsterm.m index a45792fd645..7cbaf991311 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6038,11 +6038,15 @@ ns_term_shutdown (int sig) restrict the height to just one monitor. So we override this. */ - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen { - /* When making the frame visible for the first time, we want to - constrain. Other times not. */ + /* When making the frame visible for the first time or if there is just + one screen, we want to constrain. Other times not. */ + NSUInteger nr_screens = [[NSScreen screens] count]; struct frame *f = ((EmacsView *)[self delegate])->emacsframe; NSTRACE (constrainFrameRect); + if (nr_screens == 1) + return [super constrainFrameRect:frameRect toScreen:screen]; + if (f->output_data.ns->dont_constrain || ns_menu_bar_should_be_hidden ()) return frameRect; -- 2.39.5