From 152347f79ba59deac5a15ca4a66f7a2e7dda80b7 Mon Sep 17 00:00:00 2001 From: Daniel Kariv <38776931+danielkariv@users.noreply.github.com> Date: Mon, 16 Aug 2021 10:45:23 +0300 Subject: [PATCH 1/2] Fix macOS fullscreen incorrect mouse position In relation to #40061. It seems that the issue is when the window get fullscreen, it doesn't change the window size like when it is maximized or scale up and down. So the change i made was forcing the resize event function, when getting in to or out from fullscreen mode. --- platform/osx/display_server_osx.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index 43b7d7c1e000..aa8e0d42b07c 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -190,6 +190,8 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification { [wd.window_object setContentMinSize:NSMakeSize(0, 0)]; [wd.window_object setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)]; + //Force window resize event + [self windowDidResize:notification]; } - (void)windowDidExitFullScreen:(NSNotification *)notification { @@ -217,6 +219,8 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { if (wd.on_top) { [wd.window_object setLevel:NSFloatingWindowLevel]; } + //Force window resize event + [self windowDidResize:notification]; } - (void)windowDidChangeBackingProperties:(NSNotification *)notification { From d43f7d55fd0d4206c49e5fc719cd618e4cd6f970 Mon Sep 17 00:00:00 2001 From: Daniel Kariv <38776931+danielkariv@users.noreply.github.com> Date: Mon, 16 Aug 2021 12:00:43 +0300 Subject: [PATCH 2/2] fix comments styling Changes the comments to fit with godot's styling. --- platform/osx/display_server_osx.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index aa8e0d42b07c..f037d75fbd79 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -190,7 +190,7 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification { [wd.window_object setContentMinSize:NSMakeSize(0, 0)]; [wd.window_object setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)]; - //Force window resize event + // Force window resize event. [self windowDidResize:notification]; } @@ -219,7 +219,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { if (wd.on_top) { [wd.window_object setLevel:NSFloatingWindowLevel]; } - //Force window resize event + // Force window resize event. [self windowDidResize:notification]; }