Adding some comments to explain the magic numbers

This commit is contained in:
maiconpintoabreu 2026-02-27 17:28:37 +00:00
parent 55dd966201
commit e49397e6cf
2 changed files with 18 additions and 2 deletions

View File

@ -1072,7 +1072,15 @@ Image GetClipboardImage(void)
if (!dpy) return image; if (!dpy) return image;
Window root = DefaultRootWindow(dpy); 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 clipboard = XInternAtom(dpy, "CLIPBOARD", False);
Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG

View File

@ -1030,7 +1030,15 @@ Image GetClipboardImage(void)
if (!dpy) return image; if (!dpy) return image;
Window root = DefaultRootWindow(dpy); 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 clipboard = XInternAtom(dpy, "CLIPBOARD", False);
Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG Atom targetType = XInternAtom(dpy, "image/png", False); // Ask for PNG