System/packages/glfw-minecraft-wayland/0007-Platform-Prefer-Waylan...

45 lines
1.6 KiB
Diff
Raw Permalink Normal View History

2023-02-08 21:57:48 -05:00
From 352b3bb37d79ddc9b4a7afd9ca8ad26723f17821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20H=C3=BClsmann?= <fh@cbix.de>
Date: Sun, 30 Jan 2022 00:36:32 +0100
Subject: [PATCH] Platform: Prefer Wayland over X11
When GLFW_ANY_PLATFORM is used (which is the default) native
Wayland would previously never be chosen if XWayland is also available.
---
README.md | 1 +
src/platform.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 4a3fb85c5a..9ba2994200 100644
--- a/README.md
+++ b/README.md
@@ -268,6 +268,7 @@ information on what to include when reporting a bug.
- [Wayland] Added dynamic loading of all Wayland libraries
- [Wayland] Added support for key names via xkbcommon
- [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: `CLOCK_MONOTONIC` was not correctly enabled
- [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
diff --git a/src/platform.c b/src/platform.c
index d0bbd06df5..61d06787fb 100644
--- a/src/platform.c
+++ b/src/platform.c
@@ -45,12 +45,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)