From e49397e6cfbdfb57308b5e3b8d02c2263be7c132 Mon Sep 17 00:00:00 2001 From: maiconpintoabreu Date: Fri, 27 Feb 2026 17:28:37 +0000 Subject: [PATCH] Adding some comments to explain the magic numbers --- src/platforms/rcore_desktop_glfw.c | 10 +++++++++- src/platforms/rcore_desktop_rgfw.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 613d15686..57ac76ed9 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1072,7 +1072,15 @@ Image GetClipboardImage(void) if (!dpy) return image; Window root = DefaultRootWindow(dpy); - Window win = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); + Window win = XCreateSimpleWindow( + dpy, // The connection to the X Server + root, // The 'Parent' window (usually the desktop/root) + 0, 0, // X and Y position on the screen + 1, 1, // Width and Height (1x1 pixel) + 0, // Border width + 0, // Border color + 0 // Background color + ); Atom clipboard = XInternAtom(dpy, "CLIPBOARD", False); Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index cfdd4d51f..651f1206a 100755 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -1030,7 +1030,15 @@ Image GetClipboardImage(void) if (!dpy) return image; Window root = DefaultRootWindow(dpy); - Window win = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); + Window win = XCreateSimpleWindow( + dpy, // The connection to the X Server + root, // The 'Parent' window (usually the desktop/root) + 0, 0, // X and Y position on the screen + 1, 1, // Width and Height (1x1 pixel) + 0, // Border width + 0, // Border color + 0 // Background color + ); Atom clipboard = XInternAtom(dpy, "CLIPBOARD", False); Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG