From 48fc1a7a1e90fb596662c4d59449aa011daefade Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 24 Jul 2024 19:41:34 +0200 Subject: [PATCH] fix: Allow ImHex to build under wayland again --- lib/libimhex/source/helpers/fs.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/libimhex/source/helpers/fs.cpp b/lib/libimhex/source/helpers/fs.cpp index 36fd3ba9f..7bee4a94c 100644 --- a/lib/libimhex/source/helpers/fs.cpp +++ b/lib/libimhex/source/helpers/fs.cpp @@ -23,6 +23,7 @@ #if defined(OS_WEB) #include #else + #include #include #if defined(OS_WINDOWS) #define GLFW_EXPOSE_NATIVE_WIN32 @@ -36,17 +37,21 @@ #define GLFW_EXPOSE_NATIVE_COCOA #endif #if defined(OS_LINUX) - #define GLFW_EXPOSE_NATIVE_X11 - #endif - #if defined(OS_LINUX) && defined(GLFW_WAYLAND_APP_ID) - #define GLFW_EXPOSE_NATIVE_WAYLAND + #if GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 4 + #define GLFW_EXPOSE_NATIVE_X11 + #else + #define GLFW_EXPOSE_NATIVE_WAYLAND + #endif #endif + #include - #if defined(OS_LINUX) && defined(GLFW_WAYLAND_APP_ID) - #undef GLFW_EXPOSE_NATIVE_WAYLAND - #endif - #if defined(OS_LINUX) - #undef GLFW_EXPOSE_NATIVE_X11 + + #if defined(OS_LINUX) && GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 4 + #if GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 4 + #undef GLFW_EXPOSE_NATIVE_X11 + #else + #undef GLFW_EXPOSE_NATIVE_WAYLAND + #endif #endif #if defined(OS_MACOS) #undef GLFW_EXPOSE_NATIVE_COCOA