From 1bd26277079d931ce78d493c934170c9535cf92b Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Tue, 11 May 2021 14:39:51 -0400 Subject: [PATCH] bloodshed everywhere etc --- dmenubar/dmenu.c | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/dmenubar/dmenu.c b/dmenubar/dmenu.c index 94345aa..af9fee5 100644 --- a/dmenubar/dmenu.c +++ b/dmenubar/dmenu.c @@ -39,7 +39,6 @@ static char *embed; static int bh, mw, mh; static int inputw = 0, promptw; static int lrpad; /* sum of left and right padding */ -static size_t cursor; static struct item *items = NULL; static struct item *matches, *matchend; static struct item *prev, *curr, *next, *sel; @@ -204,19 +203,6 @@ match(void) calcoffsets(); } -static void -insert(const char *str, ssize_t n) -{ - if (strlen(text) + n > sizeof text - 1) - return; - /* move existing text out of the way, insert new text, and update cursor */ - memmove(&text[cursor + n], &text[cursor], sizeof text - cursor - MAX(n, 0)); - if (n > 0) - memcpy(&text[cursor], str, n); - cursor += n; - match(); -} - static void readstdin(void) { @@ -245,32 +231,6 @@ readstdin(void) inputw = items ? TEXTW(items[imax].text) : 0; } -static void -run(void) -{ - XEvent ev; - - while (!XNextEvent(dpy, &ev)) { - if (XFilterEvent(&ev, win)) - continue; - switch(ev.type) { - case DestroyNotify: - if (ev.xdestroywindow.window != win) - break; - cleanup(); - exit(1); - case Expose: - if (ev.xexpose.count == 0) - drw_map(drw, win, 0, 0, mw, mh); - break; - case VisibilityNotify: - if (ev.xvisibility.state != VisibilityUnobscured) - XRaiseWindow(dpy, win); - break; - } - } -} - static void setup(void) { @@ -437,7 +397,7 @@ main(int argc, char *argv[]) readstdin(); setup(); - run(); + while(1); // bodge return 1; /* unreachable */ }