Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
merge lsx -> default
[dmenu.git]
/
dmenu.c
diff --git
a/dmenu.c
b/dmenu.c
index
458f5ab
..
dc1f236
100644
(file)
--- a/
dmenu.c
+++ b/
dmenu.c
@@
-41,7
+41,6
@@
static void usage(void);
static char text[BUFSIZ] = "";
static int bh, mw, mh;
static int inputw, promptw;
static char text[BUFSIZ] = "";
static int bh, mw, mh;
static int inputw, promptw;
-static int lines = 0;
static size_t cursor = 0;
static const char *font = NULL;
static const char *prompt = NULL;
static size_t cursor = 0;
static const char *font = NULL;
static const char *prompt = NULL;
@@
-49,6
+48,7
@@
static const char *normbgcolor = "#cccccc";
static const char *normfgcolor = "#000000";
static const char *selbgcolor = "#0066ff";
static const char *selfgcolor = "#ffffff";
static const char *normfgcolor = "#000000";
static const char *selbgcolor = "#0066ff";
static const char *selfgcolor = "#ffffff";
+static unsigned int lines = 0;
static unsigned long normcol[ColLast];
static unsigned long selcol[ColLast];
static Atom utf8;
static unsigned long normcol[ColLast];
static unsigned long selcol[ColLast];
static Atom utf8;
@@
-454,6
+454,7
@@
readstdin(void) {
if(items)
items[i].text = NULL;
inputw = maxstr ? textw(dc, maxstr) : 0;
if(items)
items[i].text = NULL;
inputw = maxstr ? textw(dc, maxstr) : 0;
+ lines = MIN(lines, i);
}
void
}
void
@@
-510,7
+511,7
@@
setup(void) {
XGetInputFocus(dc->dpy, &w, &di);
if(w != root && w != PointerRoot && w != None && XGetWindowAttributes(dc->dpy, w, &wa))
XGetInputFocus(dc->dpy, &w, &di);
if(w != root && w != PointerRoot && w != None && XGetWindowAttributes(dc->dpy, w, &wa))
- XTranslateCoordinates(dc->dpy,
root
, root, wa.x, wa.y, &x, &y, &dw);
+ XTranslateCoordinates(dc->dpy,
w
, root, wa.x, wa.y, &x, &y, &dw);
else
XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
for(i = 0; i < n-1; i++)
else
XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
for(i = 0; i < n-1; i++)