Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created October 23, 2021 22:27
Show Gist options
  • Save jordansissel/f56ff33258b37045c030b1517d88d157 to your computer and use it in GitHub Desktop.
Save jordansissel/f56ff33258b37045c030b1517d88d157 to your computer and use it in GitHub Desktop.
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
Display *dpy;
// Below here, Copilot generated the rest.
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
fprintf(stderr, "Cannot open display\n");
exit(1);
}
Window root = DefaultRootWindow(dpy);
XSetWindowAttributes attr;
attr.override_redirect = True;
Window win = XCreateWindow(dpy, root, 0, 0, 1, 1, 0, CopyFromParent, InputOnly, CopyFromParent, CWOverrideRedirect, &attr);
XMapRaised(dpy, win);
XFlush(dpy);
XEvent ev;
XNextEvent(dpy, &ev);
XDestroyWindow(dpy, win);
XCloseDisplay(dpy);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment