about summary refs log tree commit diff
path: root/menu.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-16 13:42:52 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-16 13:48:38 +0100
commit775ba78311768b7a944db95273822c0a567dc171 (patch)
tree13ea9cb9db8e9121cc80e9cce4186a925fb889e2 /menu.c
parentdcb741d2b1378432e226bbeea274c2e5e2508c2d (diff)
parent8b4666cb926121481905b68bf93d6e81c307e9e3 (diff)
downloadcwm-775ba78311768b7a944db95273822c0a567dc171.tar.gz
cwm-775ba78311768b7a944db95273822c0a567dc171.tar.xz
cwm-775ba78311768b7a944db95273822c0a567dc171.zip
cvsimport
* refs/heads/master:
  stray newlines
  Add search_print_text(), a default callback for mi->print in menu_filter(). While here, normalize the remaining search_print_* argument paramters.
  Consistent use of menuq_add for ssh menu.
  Now that dim.{x,y} are available early, use them before requiring a MotionNotify event.
  Set dim.{x,y} during client_init and update on resize, instead of (re)calculating only when applying hints.
  'window-search' is spelled 'menu-window'; the former snuck in during the conversion('menu-window' already existed and was properlly documented); found the hard way by sthen@ while trying to convert.
  Fold unbinding functions into one for each, key and mouse; plugs a leak when unbinding a mouse button bound to a command.
  use the correct type
  Tame the number of 'exec' and 'path' search_match wrappers. No functional change now, though more can likely go later, losing the (paritally complete or incomplete/broken) argument completion bits.
  Switch ssh menu to search_match_text; like group/window/cmd menus, use only a substring match. The previous matching is only intended for the exec menus.
  Change 'menu-window' to display all windows; then add 'menu-window-hidden' for the previous behaviour of 'menu-window'.  'menu-window' becomes the default binding; use 'bind-mouse "1" menu-window-hidden' to restore old behaviour for those who prefer.
  Normalize bind function names, based on a few categories: window, group, menu and pointer.
  Use an additional check with lstat(2) when d_type is unknown.
  revert previous; upcoming changes will hopefully deal with these more naturally.
  Add a wrapper based upon xevent handlers around client move/resize for key and mouse bindings.
  Define callbacks, then default bindings.
  Reorganize for upcoming changes.
  Remove the (8) default bindings for pointer move since they conflict with default bindings for emacs, which wins; the feature remains and can be bound to whatever users wish with cwmrc(5).
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/menu.c b/menu.c
index 44f76da..af13cbf 100644
--- a/menu.c
+++ b/menu.c
@@ -126,7 +126,6 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, const char *prompt,
 	    CurrentTime) != GrabSuccess) {
 		XUnmapWindow(X_Dpy, sc->menu.win);
 		return(NULL);
-
 	}
 
 	XGetInputFocus(X_Dpy, &focuswin, &focusrevert);
@@ -196,7 +195,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_any, 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 +365,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,
@@ -671,4 +666,3 @@ menu_windraw(struct screen_ctx *sc, Window win, const char *fmt, ...)
 
 	free(text);
 }
-