diff --git a/src/main.c b/src/main.c index e9cdae1..04b2104 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,34 @@ +// Some things taken from https://github.com/mackstann/tinywm + +#include + +#define MODMASK Mod1Mask + int main() { + Display* display; + XWindowAttributes attr; + + // Used to store the state of the cursor when resizing + XButtonEvent start; + + XEvent ev; + + bool isRunning = true; + + + if(!(dpy = XOpenDisplay(0x0))) return 1; + + XGrabKey(dpy, XKeysymToKeycode(dpy, XStringToKeysym("F1")), MODMASK, DefaultRootWindow(dpy), True, GrabModeAsync, GrabModeAsync); + XGrabButton(dpy, 1, MODMASK, DefaultRootWindow(dpy), True, ButtonPressMask|ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None); + XGrabButton(dpy, 3, MODMASK, DefaultRootWindow(dpy), True, ButtonPressMask|ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None); + + start.subwindow = None; + + while(isRunning) { + XNextEvent(dpy, &ev); + + + } + return 0; } \ No newline at end of file