Commit e404b525f1c9b06091fc745b8afb43479f8c26b6

Sam Lantinga 2021-02-03T21:31:50

KMSDRM doesn't have a window manager, so all windows are fullscreen

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index d750a35..8786bbd 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -1480,6 +1480,13 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
         return NULL;
     }
 
+    /* Some platforms don't have a window manager */
+    if (SDL_strcmp(_this->name, "KMSDRM") == 0) {
+        if (!(flags & SDL_WINDOW_FULLSCREEN)) {
+            flags |= SDL_WINDOW_FULLSCREEN;
+        }
+    }
+
     /* Some platforms have OpenGL enabled by default */
 #if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__
     if (!_this->is_dummy && !(flags & SDL_WINDOW_VULKAN) && !(flags & SDL_WINDOW_METAL) && !SDL_IsVideoContextExternal()) {