From 03b19f1487135d8e8a80e0aad5aef447776c7c11 Mon Sep 17 00:00:00 2001 From: benno Date: Mon, 25 Nov 2013 18:21:55 +0000 Subject: Log message: use u_char for buffers in yylex, for ctype calls, as done in all other parse.y in the tree found by millert@, ok okan@ --- parse.y | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/parse.y b/parse.y index e2a6885..ef46887 100644 --- a/parse.y +++ b/parse.y @@ -286,9 +286,9 @@ lookup(char *s) #define MAXPUSHBACK 128 -char *parsebuf; +u_char *parsebuf; int parseindex; -char pushback_buffer[MAXPUSHBACK]; +u_char pushback_buffer[MAXPUSHBACK]; int pushback_index = 0; int @@ -381,8 +381,8 @@ findeol(void) int yylex(void) { - char buf[8096]; - char *p; + u_char buf[8096]; + u_char *p; int quotec, next, c; int token; @@ -423,7 +423,7 @@ yylex(void) yyerror("string too long"); return (findeol()); } - *p++ = (char)c; + *p++ = c; } yylval.v.string = xstrdup(buf); return (STRING); -- cgit 1.4.1 From fa25915a75551c36495c8a0fa2754ac3091c529e Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Nov 2013 00:01:23 +0000 Subject: Rewrite active/inactive client handling in client_setactive(); client_leave() served no real purpose, likewise no reason to handle LeaveNotify events since an EnterNotify will process the next active client (and we don't have anything important to process anyway), so xev_handle_leavenotify() goes as well. Allows a simplification of client_mtf() and client_cycle_leave() for clarity. While here, unify a few client_current() checks. No intended behaviour change. --- calmwm.h | 6 ++--- client.c | 78 +++++++++++++++++++++++---------------------------------------- xevents.c | 21 ++++------------- 3 files changed, 35 insertions(+), 70 deletions(-) diff --git a/calmwm.h b/calmwm.h index d65b437..e3cedd1 100644 --- a/calmwm.h +++ b/calmwm.h @@ -368,8 +368,7 @@ void client_applysizehints(struct client_ctx *); void client_config(struct client_ctx *); struct client_ctx *client_current(void); void client_cycle(struct screen_ctx *, int); -void client_cycle_leave(struct screen_ctx *, - struct client_ctx *); +void client_cycle_leave(struct screen_ctx *); void client_delete(struct client_ctx *); void client_draw_border(struct client_ctx *); struct client_ctx *client_find(Window); @@ -378,7 +377,6 @@ void client_getsizehints(struct client_ctx *); void client_hide(struct client_ctx *); void client_hmaximize(struct client_ctx *); void client_htile(struct client_ctx *); -void client_leave(struct client_ctx *); void client_lower(struct client_ctx *); void client_map(struct client_ctx *); void client_maximize(struct client_ctx *); @@ -390,7 +388,7 @@ void client_ptrwarp(struct client_ctx *); void client_raise(struct client_ctx *); void client_resize(struct client_ctx *, int); void client_send_delete(struct client_ctx *); -void client_setactive(struct client_ctx *, int); +void client_setactive(struct client_ctx *); void client_setname(struct client_ctx *); int client_snapcalc(int, int, int, int, int); void client_transient(struct client_ctx *); diff --git a/client.c b/client.c index 173c0f5..81b2d9e 100644 --- a/client.c +++ b/client.c @@ -180,53 +180,35 @@ client_delete(struct client_ctx *cc) } void -client_leave(struct client_ctx *cc) +client_setactive(struct client_ctx *cc) { - if (cc == NULL) - cc = client_current(); - if (cc == NULL) - return; -} - -void -client_setactive(struct client_ctx *cc, int fg) -{ - struct screen_ctx *sc; - - if (cc == NULL) - cc = client_current(); - if (cc == NULL) - return; + struct screen_ctx *sc = cc->sc; + struct client_ctx *oldcc; - sc = cc->sc; + XInstallColormap(X_Dpy, cc->colormap); - if (fg) { - XInstallColormap(X_Dpy, cc->colormap); - if ((cc->flags & CLIENT_INPUT) || - ((cc->flags & CLIENT_WM_TAKE_FOCUS) == 0)) { - XSetInputFocus(X_Dpy, cc->win, - RevertToPointerRoot, CurrentTime); - } - if (cc->flags & CLIENT_WM_TAKE_FOCUS) - client_msg(cc, cwmh[WM_TAKE_FOCUS]); - conf_grab_mouse(cc->win); - /* - * If we're in the middle of alt-tabbing, don't change - * the order please. - */ - if (!sc->cycling) - client_mtf(cc); - } else - client_leave(cc); + if ((cc->flags & CLIENT_INPUT) || + ((cc->flags & CLIENT_WM_TAKE_FOCUS) == 0)) { + XSetInputFocus(X_Dpy, cc->win, + RevertToPointerRoot, CurrentTime); + } + if (cc->flags & CLIENT_WM_TAKE_FOCUS) + client_msg(cc, cwmh[WM_TAKE_FOCUS]); - if (fg && cc != client_current()) { - client_setactive(NULL, 0); - _curcc = cc; - xu_ewmh_net_active_window(sc, cc->win); + if ((oldcc = client_current())) { + oldcc->active = 0; + client_draw_border(oldcc); } - cc->active = fg; + /* If we're in the middle of cycing, don't change the order. */ + if (!sc->cycling) + client_mtf(cc); + + _curcc = cc; + cc->active = 1; client_draw_border(cc); + conf_grab_mouse(cc->win); + xu_ewmh_net_active_window(sc, cc->win); } /* @@ -640,12 +622,14 @@ client_cycle(struct screen_ctx *sc, int flags) } void -client_cycle_leave(struct screen_ctx *sc, struct client_ctx *cc) +client_cycle_leave(struct screen_ctx *sc) { + struct client_ctx *cc; + sc->cycling = 0; - client_mtf(NULL); - if (cc) { + if ((cc = client_current())) { + client_mtf(cc); group_sticky_toggle_exit(cc); XUngrabKeyboard(X_Dpy, CurrentTime); } @@ -724,14 +708,8 @@ client_placecalc(struct client_ctx *cc) static void client_mtf(struct client_ctx *cc) { - struct screen_ctx *sc; - - if (cc == NULL) - cc = client_current(); - if (cc == NULL) - return; + struct screen_ctx *sc = cc->sc; - sc = cc->sc; TAILQ_REMOVE(&sc->mruq, cc, mru_entry); TAILQ_INSERT_HEAD(&sc->mruq, cc, mru_entry); } diff --git a/xevents.c b/xevents.c index 8c07f39..a1fe019 100644 --- a/xevents.c +++ b/xevents.c @@ -43,7 +43,6 @@ static void xev_handle_destroynotify(XEvent *); static void xev_handle_configurerequest(XEvent *); static void xev_handle_propertynotify(XEvent *); static void xev_handle_enternotify(XEvent *); -static void xev_handle_leavenotify(XEvent *); static void xev_handle_buttonpress(XEvent *); static void xev_handle_buttonrelease(XEvent *); static void xev_handle_keypress(XEvent *); @@ -60,7 +59,6 @@ void (*xev_handlers[LASTEvent])(XEvent *) = { [ConfigureRequest] = xev_handle_configurerequest, [PropertyNotify] = xev_handle_propertynotify, [EnterNotify] = xev_handle_enternotify, - [LeaveNotify] = xev_handle_leavenotify, [ButtonPress] = xev_handle_buttonpress, [ButtonRelease] = xev_handle_buttonrelease, [KeyPress] = xev_handle_keypress, @@ -81,7 +79,7 @@ xev_handle_maprequest(XEvent *ee) struct client_ctx *cc = NULL, *old_cc; XWindowAttributes xattr; - if ((old_cc = client_current()) != NULL) + if ((old_cc = client_current())) client_ptrsave(old_cc); if ((cc = client_find(e->window)) == NULL) { @@ -211,13 +209,7 @@ xev_handle_enternotify(XEvent *ee) struct client_ctx *cc; if ((cc = client_find(e->window)) != NULL) - client_setactive(cc, 1); -} - -static void -xev_handle_leavenotify(XEvent *ee) -{ - client_leave(NULL); + client_setactive(cc); } /* We can split this into two event handlers. */ @@ -256,7 +248,7 @@ xev_handle_buttonrelease(XEvent *ee) { struct client_ctx *cc; - if ((cc = client_current()) != NULL) + if ((cc = client_current())) group_sticky_toggle_exit(cc); } @@ -311,17 +303,15 @@ xev_handle_keyrelease(XEvent *ee) { XKeyEvent *e = &ee->xkey; struct screen_ctx *sc; - struct client_ctx *cc; KeySym keysym; u_int i; sc = screen_fromroot(e->root); - cc = client_current(); keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0); for (i = 0; i < nitems(modkeys); i++) { if (keysym == modkeys[i]) { - client_cycle_leave(sc, cc); + client_cycle_leave(sc); break; } } @@ -344,8 +334,7 @@ xev_handle_clientmessage(XEvent *ee) client_send_delete(cc); if (e->message_type == ewmh[_NET_ACTIVE_WINDOW] && e->format == 32) { - old_cc = client_current(); - if (old_cc) + if ((old_cc = client_current())) client_ptrsave(old_cc); client_ptrwarp(cc); } -- cgit 1.4.1 From 250f98bf1552ebbff28ff4d9c7b853687065d476 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Nov 2013 14:20:32 +0000 Subject: simplify/unfold --- client.c | 8 +++----- mousefunc.c | 10 ++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/client.c b/client.c index 81b2d9e..4a5d0c8 100644 --- a/client.c +++ b/client.c @@ -781,12 +781,10 @@ client_applysizehints(struct client_ctx *cc) } /* adjust for aspect limits */ - if (cc->hint.mina > 0 && cc->hint.maxa > 0) { - if (cc->hint.maxa < - (float)cc->geom.w / cc->geom.h) + if (cc->hint.mina && cc->hint.maxa) { + if (cc->hint.maxa < (float)cc->geom.w / cc->geom.h) cc->geom.w = cc->geom.h * cc->hint.maxa; - else if (cc->hint.mina < - (float)cc->geom.h / cc->geom.w) + else if (cc->hint.mina < (float)cc->geom.h / cc->geom.w) cc->geom.h = cc->geom.w * cc->hint.mina; } diff --git a/mousefunc.c b/mousefunc.c index 31cf951..34e39ff 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -50,21 +50,19 @@ static void mousefunc_sweep_draw(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - char asize[14]; /* fits " nnnn x nnnn \0" */ + char s[14]; /* fits " nnnn x nnnn \0" */ - (void)snprintf(asize, sizeof(asize), " %4d x %-4d ", + (void)snprintf(s, sizeof(s), " %4d x %-4d ", (cc->geom.w - cc->hint.basew) / cc->hint.incw, (cc->geom.h - cc->hint.baseh) / cc->hint.inch); XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0); XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0, - xu_xft_width(sc->xftfont, asize, strlen(asize)), - sc->xftfont->height); + xu_xft_width(sc->xftfont, s, strlen(s)), sc->xftfont->height); XMapWindow(X_Dpy, sc->menuwin); XClearWindow(X_Dpy, sc->menuwin); - xu_xft_draw(sc, asize, CWM_COLOR_MENU_FONT, - 0, sc->xftfont->ascent + 1); + xu_xft_draw(sc, s, CWM_COLOR_MENU_FONT, 0, sc->xftfont->ascent + 1); } void -- cgit 1.4.1 From abf52049b9e93e026c9299f65f326b975fd2f2cc Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Nov 2013 16:24:17 +0000 Subject: Remove the option to bind a key by keycode with brackets; it never worked (and no one complained!). While it's fairly easy to fix, users should be using keysym names and not keycodes. Discussed at length months ago with todd@, matthieu@ and Owain. --- conf.c | 17 +++-------------- cwmrc.5 | 8 +++----- xevents.c | 4 +--- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/conf.c b/conf.c index 68a5351..895b681 100644 --- a/conf.c +++ b/conf.c @@ -479,17 +479,8 @@ conf_bind_kbd(struct conf *c, char *name, char *binding) substring = conf_bind_getmask(name, &mask); current_binding->modmask |= mask; - if (substring[0] == '[' && - substring[strlen(substring)-1] == ']') { - sscanf(substring, "[%d]", ¤t_binding->keycode); - current_binding->keysym = NoSymbol; - } else { - current_binding->keycode = 0; - current_binding->keysym = XStringToKeysym(substring); - } - - if (current_binding->keysym == NoSymbol && - current_binding->keycode == 0) { + current_binding->keysym = XStringToKeysym(substring); + if (current_binding->keysym == NoSymbol) { free(current_binding); return; } @@ -530,9 +521,7 @@ conf_unbind_kbd(struct conf *c, struct keybinding *unbind) if (key->modmask != unbind->modmask) continue; - if ((key->keycode != 0 && key->keysym == NoSymbol && - key->keycode == unbind->keycode) || - key->keysym == unbind->keysym) { + if (key->keysym == unbind->keysym) { TAILQ_REMOVE(&c->keybindingq, key, entry); if (key->argtype & ARG_CHAR) free(key->argument.c); diff --git a/cwmrc.5 b/cwmrc.5 index 9f75dbd..2d00e73 100644 --- a/cwmrc.5 +++ b/cwmrc.5 @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 17 2013 $ +.Dd $Mdocdate: July 8 2013 $ .Dt CWMRC 5 .Os .Sh NAME @@ -84,10 +84,8 @@ The Mod4 key (normally the windows key). .Pp The .Sq - -should be followed by either a keysym name, taken from -.Pa /usr/X11R6/include/X11/keysymdef.h , -or a numerical keycode value enclosed in -.Dq [] . +should be followed by a keysym name, taken from +.Pa /usr/X11R6/include/X11/keysymdef.h . The .Ar command may either be one from the diff --git a/xevents.c b/xevents.c index a1fe019..f89198c 100644 --- a/xevents.c +++ b/xevents.c @@ -275,9 +275,7 @@ xev_handle_keypress(XEvent *ee) if ((kb->modmask | modshift) != e->state) continue; - if ((kb->keycode != 0 && kb->keysym == NoSymbol && - kb->keycode == e->keycode) || kb->keysym == - (modshift == 0 ? keysym : skeysym)) + if (kb->keysym == (modshift == 0 ? keysym : skeysym)) break; } -- cgit 1.4.1 From 1b6ef8e9edfca41c4339c83b481d47d839100984 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Nov 2013 17:04:35 +0000 Subject: alter -r1.145 getsizehints to deal with clients that don't have WM_NORMAL_HINTS. --- client.c | 64 +++++++++++++++++++++++++++++----------------------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/client.c b/client.c index 4a5d0c8..9834757 100644 --- a/client.c +++ b/client.c @@ -718,52 +718,46 @@ void client_getsizehints(struct client_ctx *cc) { long tmp; - XSizeHints *size; + XSizeHints size; - if ((size = XAllocSizeHints()) == NULL) - warnx("XAllocSizeHints failure"); + if (!XGetWMNormalHints(X_Dpy, cc->win, &size, &tmp)) + size.flags = 0; - if (!XGetWMNormalHints(X_Dpy, cc->win, size, &tmp)) - size->flags = 0; + cc->hint.flags = size.flags; - cc->hint.flags = size->flags; - - if (size->flags & PBaseSize) { - cc->hint.basew = size->base_width; - cc->hint.baseh = size->base_height; - } else if (size->flags & PMinSize) { - cc->hint.basew = size->min_width; - cc->hint.baseh = size->min_height; + if (size.flags & PBaseSize) { + cc->hint.basew = size.base_width; + cc->hint.baseh = size.base_height; + } else if (size.flags & PMinSize) { + cc->hint.basew = size.min_width; + cc->hint.baseh = size.min_height; } - if (size->flags & PMinSize) { - cc->hint.minw = size->min_width; - cc->hint.minh = size->min_height; - } else if (size->flags & PBaseSize) { - cc->hint.minw = size->base_width; - cc->hint.minh = size->base_height; + if (size.flags & PMinSize) { + cc->hint.minw = size.min_width; + cc->hint.minh = size.min_height; + } else if (size.flags & PBaseSize) { + cc->hint.minw = size.base_width; + cc->hint.minh = size.base_height; } - if (size->flags & PMaxSize) { - cc->hint.maxw = size->max_width; - cc->hint.maxh = size->max_height; + if (size.flags & PMaxSize) { + cc->hint.maxw = size.max_width; + cc->hint.maxh = size.max_height; } - if (size->flags & PResizeInc) { - cc->hint.incw = size->width_inc; - cc->hint.inch = size->height_inc; + if (size.flags & PResizeInc) { + cc->hint.incw = size.width_inc; + cc->hint.inch = size.height_inc; } cc->hint.incw = MAX(1, cc->hint.incw); cc->hint.inch = MAX(1, cc->hint.inch); - if (size->flags & PAspect) { - if (size->min_aspect.x > 0) - cc->hint.mina = (float)size->min_aspect.y / - size->min_aspect.x; - if (size->max_aspect.y > 0) - cc->hint.maxa = (float)size->max_aspect.x / - size->max_aspect.y; + if (size.flags & PAspect) { + if (size.min_aspect.x > 0) + cc->hint.mina = (float)size.min_aspect.y / + size.min_aspect.x; + if (size.max_aspect.y > 0) + cc->hint.maxa = (float)size.max_aspect.x / + size.max_aspect.y; } - - if (size) - XFree(size); } void -- cgit 1.4.1 From 5e67a12262c061ecabc03e1cd73fdbb5c3c00196 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Nov 2013 18:34:34 +0000 Subject: like gap, make snapdist per screen --- calmwm.h | 1 + conf.c | 1 + kbfunc.c | 4 ++-- mousefunc.c | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/calmwm.h b/calmwm.h index e3cedd1..8ceba9e 100644 --- a/calmwm.h +++ b/calmwm.h @@ -216,6 +216,7 @@ struct screen_ctx { Window rootwin; Window menuwin; int cycling; + int snapdist; struct geom view; /* viewable area */ struct geom work; /* workable area, gap-applied */ struct gap gap; diff --git a/conf.c b/conf.c index 895b681..970b0ce 100644 --- a/conf.c +++ b/conf.c @@ -103,6 +103,7 @@ conf_screen(struct screen_ctx *sc) XftColor xc; sc->gap = Conf.gap; + sc->snapdist = Conf.snapdist; sc->xftfont = XftFontOpenXlfd(X_Dpy, sc->which, Conf.font); if (sc->xftfont == NULL) { diff --git a/kbfunc.c b/kbfunc.c index 4c28a2b..9c0effc 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -101,10 +101,10 @@ kbfunc_client_moveresize(struct client_ctx *cc, union arg *arg) cc->geom.x += client_snapcalc(cc->geom.x, cc->geom.x + cc->geom.w + (cc->bwidth * 2), - sc->work.x, sc->work.w, Conf.snapdist); + sc->work.x, sc->work.w, sc->snapdist); cc->geom.y += client_snapcalc(cc->geom.y, cc->geom.y + cc->geom.h + (cc->bwidth * 2), - sc->work.y, sc->work.h, Conf.snapdist); + sc->work.y, sc->work.h, sc->snapdist); client_move(cc); xu_ptr_getpos(cc->win, &x, &y); diff --git a/mousefunc.c b/mousefunc.c index 34e39ff..fbcc764 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -147,10 +147,10 @@ mousefunc_client_move(struct client_ctx *cc, void *arg) cc->geom.x += client_snapcalc(cc->geom.x, cc->geom.x + cc->geom.w + (cc->bwidth * 2), - sc->work.x, sc->work.w, Conf.snapdist); + sc->work.x, sc->work.w, sc->snapdist); cc->geom.y += client_snapcalc(cc->geom.y, cc->geom.y + cc->geom.h + (cc->bwidth * 2), - sc->work.y, sc->work.h, Conf.snapdist); + sc->work.y, sc->work.h, sc->snapdist); /* don't move more than 60 times / second */ if ((ev.xmotion.time - ltime) > (1000 / 60)) { -- cgit 1.4.1 From 6b72168d9243bed163cd90d6271b5df7d151f6e8 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 2 Dec 2013 14:30:12 +0000 Subject: Since we use IconicState as our hidden state, check for the hidden flag and unmanage the client if we're not hidden (basically if NormalState) during an UnmapNotify event. Resolves an issue with mplayer going fullscreen while not using NetWM hints; behaviour regression reported by Ido Admon. --- xevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xevents.c b/xevents.c index f89198c..f111c84 100644 --- a/xevents.c +++ b/xevents.c @@ -101,8 +101,10 @@ xev_handle_unmapnotify(XEvent *ee) if (e->send_event) { cc->state = WithdrawnState; xu_set_wm_state(cc->win, cc->state); - } else - client_hide(cc); + } else { + if (!(cc->flags & CLIENT_HIDDEN)) + client_delete(cc); + } } } -- cgit 1.4.1 From d1b232fe8111cb748383727528aa90bbe740b507 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 2 Dec 2013 19:30:27 +0000 Subject: Prepend the group shortcut in the client search menu; from Thomas Adam. Likewise, prepend shortcut in unhide menu. --- mousefunc.c | 3 ++- search.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mousefunc.c b/mousefunc.c index fbcc764..05cdfe2 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -231,7 +231,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg) continue; mi = xcalloc(1, sizeof(*mi)); - (void)strlcpy(mi->text, wname, sizeof(mi->text)); + (void)snprintf(mi->text, sizeof(mi->text), + "(%d) %s", cc->group->shortcut, wname); mi->ctx = cc; TAILQ_INSERT_TAIL(&menuq, mi, entry); } diff --git a/search.c b/search.c index 20e7621..4d5a7c1 100644 --- a/search.c +++ b/search.c @@ -142,8 +142,8 @@ search_print_client(struct menu *mi, int list) if (list) cc->matchname = cc->name; - (void)snprintf(mi->print, sizeof(mi->print), "%c%s", flag, - cc->matchname); + (void)snprintf(mi->print, sizeof(mi->print), "(%d) %c%s", + cc->group->shortcut, flag, cc->matchname); if (!list && cc->matchname != cc->name && strlen(mi->print) < sizeof(mi->print) - 1) { -- cgit 1.4.1 From 161ed1801aa57e0fbb2f88be508d2dd0d1873d09 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 2 Dec 2013 19:49:26 +0000 Subject: Always highlight the first menu item (helpful to see selected items when not using a mouse and therefore not generating Expose/MotionNotify events); from Thomas Adam. --- menu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/menu.c b/menu.c index ddb1c65..822e3b2 100644 --- a/menu.c +++ b/menu.c @@ -427,10 +427,8 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq) xu_xft_draw(sc, text, CWM_COLOR_MENU_FONT, 0, y); n++; } - if (mc->hasprompt && n > 1 && (mc->searchstr[0] != '\0')) { - mc->entry = 1; - menu_draw_entry(mc, resultq, mc->entry, 1); - } + if (mc->hasprompt && n > 1) + menu_draw_entry(mc, resultq, 1, 1); } static void -- cgit 1.4.1 From 5dc65d9242c423fd4f45ec48c32e525d9f1300f2 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 2 Dec 2013 20:01:19 +0000 Subject: When we receive a NotionNotify event, there's no need to (incorrectly might I add) redraw the top menu selection. --- menu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/menu.c b/menu.c index 822e3b2..a6d448f 100644 --- a/menu.c +++ b/menu.c @@ -475,9 +475,6 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct menu_q *resultq) menu_draw_entry(mc, resultq, mc->entry, 1); } else (void)xu_ptr_regrab(MENUGRABMASK, Conf.cursor[CF_DEFAULT]); - - if (mc->hasprompt) - menu_draw_entry(mc, resultq, 1, 1); } static struct menu * -- cgit 1.4.1