Skip to content

Instantly share code, notes, and snippets.

@nowrep
Created October 18, 2021 21:29
Show Gist options
  • Save nowrep/7e5b4d520cdc9d8a608674239b0fa897 to your computer and use it in GitHub Desktop.
Save nowrep/7e5b4d520cdc9d8a608674239b0fa897 to your computer and use it in GitHub Desktop.
Sway bug #6605
// gcc sway6605.c -lX11 -o sway6605
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xlib.h>
int main() {
Display *display;
Window window;
XEvent event;
int screen;
display = XOpenDisplay(NULL);
screen = DefaultScreen(display);
window = XCreateSimpleWindow(display, RootWindow(display, screen), 10, 10, 100, 100, 1, BlackPixel(display, screen), WhitePixel(display, screen));
for (int i = 0; i < 1000; ++i) {
XMapWindow(display, window);
XFlush(display);
usleep(10000);
XUnmapWindow(display, window);
XFlush(display);
}
XDestroyWindow(display, window);
XCloseDisplay(display);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment