From 642262e30e1340ad0dd386a2e40875edf2c79bca Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 20 Jan 2025 00:39:43 -0500 Subject: [PATCH] cocoa: Fix mousegrab when going fullscreen. When going into a fullscreen space, update mouseConfinementRect once the transition is done. When going exclusive fullscreen, force a window sync so the transition is complete before we do the update. Fixes #9088. --- src/video/cocoa/SDL_cocoawindow.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index c58e851b30..06ba56ad4d 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1377,6 +1377,8 @@ static NSCursor *Cocoa_GetDesiredCursor(void) window->h = 0; [self windowDidMove:aNotification]; [self windowDidResize:aNotification]; + + Cocoa_UpdateClipCursor(window); } } @@ -1516,6 +1518,8 @@ static NSCursor *Cocoa_GetDesiredCursor(void) if (!(window->flags & SDL_WINDOW_HIDDEN)) { Cocoa_ShowWindow(SDL_GetVideoDevice(), window); } + + Cocoa_UpdateClipCursor(window); } } @@ -2935,6 +2939,8 @@ SDL_FullscreenResult Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Windo } ScheduleContextUpdates(data); + Cocoa_SyncWindow(_this, window); + Cocoa_UpdateClipCursor(window); } return SDL_FULLSCREEN_SUCCEEDED;