summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorkatalx2026-01-28 21:08:09 -0500
committerkatalx2026-01-28 21:08:09 -0500
commitf2f4239d6e33a5415daaef5e0a322fae38bd2ec1 (patch)
tree7f7dbb60b001340768a49ac89c658e10f6c23336 /ui.c
parent46f113fd06d6fbfec73b35af1c00951085a5a1ab (diff)
eurgh
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui.c b/ui.c
index 26bf56a..f8c728c 100644
--- a/ui.c
+++ b/ui.c
@@ -24,7 +24,7 @@ static Font freg, fital;
void
ui_init(int argc, char **argv)
{
- dsp = XOpenDisplay("");
+ dsp = XOpenDisplay(NULL);
scr = DefaultScreen(dsp);
fg = BlackPixel(dsp, scr);
bg = WhitePixel(dsp, scr);
@@ -39,7 +39,7 @@ ui_init(int argc, char **argv)
DefaultRootWindow(dsp),
szhint.x, szhint.y,
szhint.width, szhint.height,
- 5 /* border width */,
+ 2 /* border width */,
fg, bg);
/* TODO: replace with modern XSetWMProperties */
@@ -51,6 +51,7 @@ ui_init(int argc, char **argv)
XSetBackground(dsp, gc, bg);
XSetForeground(dsp, gc, fg);
+ /* TODO: quit events, how do they work? */
XSelectInput(dsp, win, KeyPressMask | ExposureMask);
XMapRaised(dsp, win);
@@ -82,6 +83,7 @@ ui_wait_event(UiEvent *e)
{
XEvent ev;
KeySym sym;
+loop:
XNextEvent(dsp, &ev);
switch (ev.type) {
case KeyPress:
@@ -99,6 +101,7 @@ ui_wait_event(UiEvent *e)
return 1;
}
fprintf(stderr, "[Unknown event %d]\n", ev.type);
+ goto loop;
return 0;
}