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.
This commit is contained in:
Ryan C. Gordon
2025-01-20 00:39:43 -05:00
parent d5766bc4b8
commit 642262e30e

View File

@@ -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;