Просмотр исходного кода

Prefer Wayland over X11

When GLFW_ANY_PLATFORM is used (which is the default), X11 would be
selected on a Wayland system with XWayland and where XDG_SESSION_TYPE
was not set.

Closes #2035
Florian Hülsmann 3 лет назад
Родитель
Сommit
65102e2005
2 измененных файлов с 4 добавлено и 3 удалено
  1. 1 0
      README.md
  2. 3 3
      src/platform.c

+ 1 - 0
README.md

@@ -358,6 +358,7 @@ information on what to include when reporting a bug.
  - [Wayland] Disabled alpha channel for opaque windows on systems lacking
    `EGL_EXT_present_opaque` (#1895)
  - [Wayland] Removed support for `wl_shell` (#1443)
+ - [Wayland] Prefer Wayland over X11 if both are available (#2035)
  - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
  - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
  - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault

+ 3 - 3
src/platform.c

@@ -50,12 +50,12 @@ static const struct
 #if defined(_GLFW_COCOA)
     { GLFW_PLATFORM_COCOA, _glfwConnectCocoa },
 #endif
-#if defined(_GLFW_X11)
-    { GLFW_PLATFORM_X11, _glfwConnectX11 },
-#endif
 #if defined(_GLFW_WAYLAND)
     { GLFW_PLATFORM_WAYLAND, _glfwConnectWayland },
 #endif
+#if defined(_GLFW_X11)
+    { GLFW_PLATFORM_X11, _glfwConnectX11 },
+#endif
 };
 
 GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform)