summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui.c7
-rw-r--r--xmenu.corebin0 -> 285632 bytes
2 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;
}
diff --git a/xmenu.core b/xmenu.core
new file mode 100644
index 0000000..230ea01
--- /dev/null
+++ b/xmenu.core
Binary files differ