From 55dd966201721d1fc41d0f415ccce74f33fdf450 Mon Sep 17 00:00:00 2001 From: maiconpintoabreu Date: Fri, 27 Feb 2026 16:48:38 +0000 Subject: [PATCH] Adding another check to make sure that only X11 include X11 libs --- src/platforms/rcore_desktop_glfw.c | 4 ++-- src/platforms/rcore_desktop_rgfw.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 5f2c2e5d8..613d15686 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1043,7 +1043,7 @@ const char *GetClipboardText(void) return glfwGetClipboardString(platform.handle); } -#if SUPPORT_CLIPBOARD_IMAGE && defined(__linux__) +#if SUPPORT_CLIPBOARD_IMAGE && defined(__linux__) && defined(_GLFW_X11) #include #include #endif @@ -1065,7 +1065,7 @@ Image GetClipboardImage(void) if (bmpData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); else image = LoadImageFromMemory(".bmp", (const unsigned char *)bmpData, (int)dataSize); -#elif defined(__linux__) +#elif defined(__linux__) && defined(_GLFW_X11) // Implementation based on https://github.com/ColleagueRiley/Clipboard-Copy-Paste/blob/main/x11.c Display* dpy = XOpenDisplay(NULL); diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 1a3fdab8b..cfdd4d51f 100755 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -999,7 +999,7 @@ const char *GetClipboardText(void) #define WINBASE_ALREADY_INCLUDED #define WINGDI_ALREADY_INCLUDED #include "../external/win32_clipboard.h" -#elif defined(__linux__) +#elif defined(__linux__) && defined(DRGFW_X11) #include #include #endif @@ -1023,7 +1023,7 @@ Image GetClipboardImage(void) if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data"); else image = LoadImageFromMemory(".bmp", (const unsigned char *)fileData, dataSize); -#elif defined(__linux__) +#elif defined(__linux__) && defined(DRGFW_X11) // Implementation based on https://github.com/ColleagueRiley/Clipboard-Copy-Paste/blob/main/x11.c Display* dpy = XOpenDisplay(NULL);