소스 검색

uikit: Send fullscreen enter/leave events

Send fullscreen enter/leave events, which will implicitly update the fullscreen flag. Manually setting the flag will suppress attempts to send the events later, as the flag is used for deduplication purposes in the event code.
Frank Praznik 1 년 전
부모
커밋
9c3e831e33
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      src/video/uikit/SDL_uikitwindow.m

+ 1 - 5
src/video/uikit/SDL_uikitwindow.m

@@ -309,11 +309,7 @@ void UIKit_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_boo
 int UIKit_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
 {
     @autoreleasepool {
-        if (fullscreen) {
-            window->flags |= SDL_WINDOW_FULLSCREEN;
-        } else {
-            window->flags &= ~SDL_WINDOW_FULLSCREEN;
-        }
+        SDL_SendWindowEvent(window, fullscreen ? SDL_EVENT_WINDOW_ENTER_FULLSCREEN : SDL_EVENT_WINDOW_LEAVE_FULLSCREEN, 0, 0);
         UIKit_UpdateWindowBorder(_this, window);
     }
     return 0;