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).
This commit is contained in:
36
search.c
36
search.c
@@ -36,10 +36,8 @@
|
||||
#define PATH_ANY 0x0001
|
||||
#define PATH_EXEC 0x0002
|
||||
|
||||
static void search_match_path(struct menu_q *, struct menu_q *,
|
||||
static void search_match_path_type(struct menu_q *, struct menu_q *,
|
||||
char *, int);
|
||||
static void search_match_path_exec(struct menu_q *, struct menu_q *,
|
||||
char *);
|
||||
static int strsubmatch(char *, char *, int);
|
||||
|
||||
void
|
||||
@@ -107,7 +105,13 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
}
|
||||
|
||||
void
|
||||
search_print_cmd(struct menu *mi, int i)
|
||||
search_print_text(struct menu *mi, int listing)
|
||||
{
|
||||
(void)snprintf(mi->print, sizeof(mi->print), "%s", mi->text);
|
||||
}
|
||||
|
||||
void
|
||||
search_print_cmd(struct menu *mi, int listing)
|
||||
{
|
||||
struct cmd_ctx *cmd = (struct cmd_ctx *)mi->ctx;
|
||||
|
||||
@@ -115,7 +119,7 @@ search_print_cmd(struct menu *mi, int i)
|
||||
}
|
||||
|
||||
void
|
||||
search_print_group(struct menu *mi, int i)
|
||||
search_print_group(struct menu *mi, int listing)
|
||||
{
|
||||
struct group_ctx *gc = (struct group_ctx *)mi->ctx;
|
||||
|
||||
@@ -125,7 +129,7 @@ search_print_group(struct menu *mi, int i)
|
||||
}
|
||||
|
||||
void
|
||||
search_print_client(struct menu *mi, int list)
|
||||
search_print_client(struct menu *mi, int listing)
|
||||
{
|
||||
struct client_ctx *cc = (struct client_ctx *)mi->ctx;
|
||||
char flag = ' ';
|
||||
@@ -141,7 +145,8 @@ search_print_client(struct menu *mi, int list)
|
||||
}
|
||||
|
||||
static void
|
||||
search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, int flag)
|
||||
search_match_path_type(struct menu_q *menuq, struct menu_q *resultq,
|
||||
char *search, int flag)
|
||||
{
|
||||
char pattern[PATH_MAX];
|
||||
glob_t g;
|
||||
@@ -162,16 +167,10 @@ search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, in
|
||||
globfree(&g);
|
||||
}
|
||||
|
||||
static void
|
||||
search_match_path_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
{
|
||||
return(search_match_path(menuq, resultq, search, PATH_EXEC));
|
||||
}
|
||||
|
||||
void
|
||||
search_match_path_any(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
{
|
||||
return(search_match_path(menuq, resultq, search, PATH_ANY));
|
||||
return(search_match_path_type(menuq, resultq, search, PATH_ANY));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -208,14 +207,9 @@ search_match_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
if (mj == NULL)
|
||||
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
search_match_exec_path(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
{
|
||||
search_match_exec(menuq, resultq, search);
|
||||
if (TAILQ_EMPTY(resultq))
|
||||
search_match_path_exec(menuq, resultq, search);
|
||||
search_match_path_type(menuq, resultq, search, PATH_EXEC);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user