X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu.c;h=1206e95d2bcdcef5e45ad72923e1c84ff811e31d;hb=abd9fbb79a2497444a42671937e0c476217ca371;hp=e48733380f3880c6a9965ecdaf1c2c3cdffd6c96;hpb=4d8a646958fa2e0c8fe9d8da3dd26357e8bb4317;p=dmenu.git diff --git a/dmenu.c b/dmenu.c index e487333..1206e95 100644 --- a/dmenu.c +++ b/dmenu.c @@ -586,12 +586,13 @@ run(void) { void setup(Bool topbar) { - int i, j, n, x, y; - XModifierKeymap *modmap; - XSetWindowAttributes wa; + int i, j, x, y; #if XINERAMA + int n; XineramaScreenInfo *info = NULL; #endif + XModifierKeymap *modmap; + XSetWindowAttributes wa; /* init modifier map */ modmap = XGetModifierMapping(dpy); @@ -618,9 +619,8 @@ setup(Bool topbar) { /* menu window geometry */ mh = dc.font.height + 2; #if XINERAMA - if(XineramaIsActive(dpy)) { + if(XineramaIsActive(dpy) && (info = XineramaQueryScreens(dpy, &n))) { i = 0; - info = XineramaQueryScreens(dpy, &n); if(n > 1) { int di; unsigned int dui;