aboutsummaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorokan2016-12-06 21:54:10 +0000
committerokan2016-12-06 21:54:10 +0000
commit282cc4b1b068884308cccec1d615640fbbe6d9f7 (patch)
tree38b8a050891f42c77372996b7575fc3e7769aff1 /menu.c
parentbeda23742b6a37852c4ede98d865a36c6bb953f1 (diff)
downloadcwm-282cc4b1b068884308cccec1d615640fbbe6d9f7.tar.gz
Add search_print_text(), a default callback for mi->print in menu_filter(). While
here, normalize the remaining search_print_* argument paramters.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/menu.c b/menu.c
index c566304..1ea3ea7 100644
--- a/menu.c
+++ b/menu.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: menu.c,v 1.99 2016/12/01 20:28:19 okan Exp $
+ * $OpenBSD: menu.c,v 1.100 2016/12/06 21:54:10 okan Exp $
*/
#include <sys/types.h>
@@ -196,7 +196,7 @@ menu_complete_path(struct menu_ctx *mc)
TAILQ_INIT(&menuq);
if ((mi = menu_filter(sc, &menuq, mc->searchstr, NULL,
- (CWM_MENU_DUMMY), search_match_path, NULL)) != NULL) {
+ (CWM_MENU_DUMMY), search_match_path, search_print_text)) != NULL) {
mr->abort = mi->abort;
mr->dummy = mi->dummy;
if (mi->text[0] != '\0')
@@ -366,11 +366,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
}
TAILQ_FOREACH(mi, resultq, resultentry) {
- if (mc->print != NULL)
- (*mc->print)(mi, mc->listing);
- else
- (void)snprintf(mi->print, sizeof(mi->print),
- "%s", mi->text);
+ (*mc->print)(mi, mc->listing);
XftTextExtentsUtf8(X_Dpy, sc->xftfont,
(const FcChar8*)mi->print,