|
@@ -116,36 +116,45 @@ Android_SetWindowTitle(_THIS, SDL_Window *window)
|
|
|
void
|
|
|
Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
|
|
|
{
|
|
|
- /* If the window is being destroyed don't change visible state */
|
|
|
- if (!window->is_destroying) {
|
|
|
- Android_JNI_SetWindowStyle(fullscreen);
|
|
|
- }
|
|
|
+ SDL_LockMutex(Android_ActivityMutex);
|
|
|
|
|
|
- /* Ensure our size matches reality after we've executed the window style change.
|
|
|
- *
|
|
|
- * It is possible that we've set width and height to the full-size display, but on
|
|
|
- * Samsung DeX or Chromebooks or other windowed Android environemtns, our window may
|
|
|
- * still not be the full display size.
|
|
|
- */
|
|
|
- if (!SDL_IsDeXMode() && !SDL_IsChromebook()) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (window == Android_Window) {
|
|
|
|
|
|
- SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
|
|
+ /* If the window is being destroyed don't change visible state */
|
|
|
+ if (!window->is_destroying) {
|
|
|
+ Android_JNI_SetWindowStyle(fullscreen);
|
|
|
+ }
|
|
|
|
|
|
- if (!data || !data->native_window) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ /* Ensure our size matches reality after we've executed the window style change.
|
|
|
+ *
|
|
|
+ * It is possible that we've set width and height to the full-size display, but on
|
|
|
+ * Samsung DeX or Chromebooks or other windowed Android environemtns, our window may
|
|
|
+ * still not be the full display size.
|
|
|
+ */
|
|
|
+ if (!SDL_IsDeXMode() && !SDL_IsChromebook()) {
|
|
|
+ goto endfunction;
|
|
|
+ }
|
|
|
|
|
|
- int old_w = window->w;
|
|
|
- int old_h = window->h;
|
|
|
+ SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
|
|
|
|
|
- int new_w = ANativeWindow_getWidth(data->native_window);
|
|
|
- int new_h = ANativeWindow_getHeight(data->native_window);
|
|
|
+ if (!data || !data->native_window) {
|
|
|
+ goto endfunction;
|
|
|
+ }
|
|
|
+
|
|
|
+ int old_w = window->w;
|
|
|
+ int old_h = window->h;
|
|
|
|
|
|
- if (old_w != new_w || old_h != new_h) {
|
|
|
- SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, new_w, new_h);
|
|
|
+ int new_w = ANativeWindow_getWidth(data->native_window);
|
|
|
+ int new_h = ANativeWindow_getHeight(data->native_window);
|
|
|
+
|
|
|
+ if (old_w != new_w || old_h != new_h) {
|
|
|
+ SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, new_w, new_h);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+endfunction:
|
|
|
+
|
|
|
+ SDL_UnlockMutex(Android_ActivityMutex);
|
|
|
}
|
|
|
|
|
|
void
|