Prechádzať zdrojové kódy

Log information about Wayland environment detection

Sam Lantinga 3 mesiacov pred
rodič
commit
7642c0468d

+ 3 - 0
src/video/wayland/SDL_waylandvideo.c

@@ -495,6 +495,9 @@ static bool Wayland_IsPreferred(struct wl_display *display)
 
     wl_registry_destroy(registry);
 
+    if (!preferred_data.has_fifo_v1) {
+        SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "This compositor lacks support for the fifo-v1 protocol; falling back to XWayland for GPU performance reasons (set SDL_VIDEO_DRIVER=wayland to override)");
+    }
     return preferred_data.has_fifo_v1;
 }
 

+ 2 - 0
src/video/x11/SDL_x11video.c

@@ -285,6 +285,8 @@ static SDL_VideoDevice *X11_CreateDevice(void)
 
     data->is_xwayland = X11_IsXWayland(x11_display);
     if (data->is_xwayland) {
+        SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "Detected XWayland");
+
         device->device_caps |= VIDEO_DEVICE_CAPS_MODE_SWITCHING_EMULATED |
                                VIDEO_DEVICE_CAPS_DISABLE_MOUSE_WARP_ON_FULLSCREEN_TRANSITIONS;
     }