From 03b4e889e5ee7c6f9b9c0e189f7d6560b8d0f67d Mon Sep 17 00:00:00 2001
From: tomcw <tomcw@users.noreply.github.com>
Date: Tue, 10 Oct 2017 22:11:36 +0100
Subject: [PATCH] Stop ASSERT when 'mouse entering Apple screen area' (#464)

---
 source/Frame.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/source/Frame.cpp b/source/Frame.cpp
index 9202fcab..920ba6c9 100644
--- a/source/Frame.cpp
+++ b/source/Frame.cpp
@@ -2699,8 +2699,11 @@ static void FrameSetCursorPosByMousePos(int x, int y, int dx, int dy, bool bLeav
 	else	// Mouse entering Apple screen area
 	{
 //		sprintf(szDbg, "[MOUSE_ENTERING] x=%d, y=%d\n", x, y); OutputDebugString(szDbg);
-		x -= (viewportx+2-MAGICX); if (x < 0) x = 0;
-		y -= (viewporty+2-MAGICY); if (y < 0) y = 0;
+		if (!g_bIsFullScreen)	// GH#464
+		{
+			x -= (viewportx+2-MAGICX); if (x < 0) x = 0;
+			y -= (viewporty+2-MAGICY); if (y < 0) y = 0;
+		}
 
 		_ASSERT(x <= g_nViewportCX);
 		_ASSERT(y <= g_nViewportCY);