Browse Source

x stuff

master
Martin Dørum 3 years ago
parent
commit
4de545f070
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      main.c

+ 10
- 0
main.c View File



freeaddrinfo(info); freeaddrinfo(info);


// This is useful
if (getenv("DISPLAY") == NULL) {
setenv("DISPLAY", ":0", 1);
}

Display *display = XOpenDisplay(NULL); Display *display = XOpenDisplay(NULL);
if (display == NULL) {
fprintf(stderr, "Failed to open display.\n");
return 1;
}

Window root = XDefaultRootWindow(display); Window root = XDefaultRootWindow(display);
XWindowAttributes gwa; XWindowAttributes gwa;
XGetWindowAttributes(display, root, &gwa); XGetWindowAttributes(display, root, &gwa);

Loading…
Cancel
Save