diff options
| author | Arslaan Pathan <[email protected]> | 2026-05-14 13:05:34 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-05-14 13:05:34 +1200 |
| commit | 07b64f09a3b866520d8e4729f11f882780cdb6e3 (patch) | |
| tree | 5f40efa2e381e3ef5a55d437271ff18a2e681757 | |
| download | simple-x11-window-07b64f09a3b866520d8e4729f11f882780cdb6e3.tar.xz simple-x11-window-07b64f09a3b866520d8e4729f11f882780cdb6e3.zip | |
Initial commit
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | main.c | 22 | ||||
| -rw-r--r-- | meson.build | 5 |
3 files changed, 29 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e7bf47 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +.cache @@ -0,0 +1,22 @@ +#include <X11/X.h> +#include <X11/Xlib.h> +#include <stdio.h> + +int main() { + XEvent event; + Display* display = XOpenDisplay(NULL); + if (display == NULL) { + printf("cant\n"); + } + Window window = XCreateSimpleWindow(display, DefaultRootWindow(display), 50, 50, 900, 600, 1, BlackPixel(display, 0), WhitePixel(display, 0)); + XMapWindow(display, window); + XSelectInput(display, window, ExposureMask); + + while (1) { + XNextEvent(display, &event); + if (event.type == Expose) { + XDrawString(display, window, DefaultGC(display, 0), 10, 10, "X11 > Wayland", 13); + } + } + return 0; +} diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..d3985a2 --- /dev/null +++ b/meson.build @@ -0,0 +1,5 @@ +project('simple-x11-window', 'c') + +x11_dep = dependency('x11') + +executable('simple-x11-window', 'main.c', dependencies: x11_dep) |
