From 3cdbd5cfd59049d7e39a94e127d68df4983a40ca Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sun, 29 Mar 2009 16:40:59 +0200 Subject: [PATCH] Exit full-screen if the window moves The window is not supposed to move in full-screen mode so if this happens then exit full-screen. This situation can occur e.g. if the window is on a screen that gets unplugged. --- src/MacVim/MMWindowController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 6d00d298..f62501d0 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -765,6 +765,15 @@ if (!setupDone) return; + if (fullscreenEnabled) { + // HACK! The full-screen is not supposed to be able to be moved. If we + // do get here while in full-screen something unexpected happened (e.g. + // the full-screen window was on an external display that got + // unplugged) and we handle this situation by leaving full-screen. + [self leaveFullscreen]; + return; + } + if (windowAutosaveKey) { NSRect frame = [decoratedWindow frame]; NSPoint topLeft = { frame.origin.x, NSMaxY(frame) }; -- 2.11.4.GIT