summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-03-03 14:45:39 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-03-03 14:55:56 +0100
commite200c0efde7c6da7cd3357dd4c322a5dd6846518 (patch)
treea7c77a7531ed8fdcfb497b83ef604af4a5a12c50 /src/window.c
parent838d28ab5d5a3c9177e43e66df088f70cc243303 (diff)
downloadratpoison-e200c0efde7c6da7cd3357dd4c322a5dd6846518.zip
Search windows names for exact match then for fuzzy match
* Contrary to the recent find_group change, windows are still searched by number first. This is inconsistent and a choice has to be made.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index a383c72..1caf8e9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -283,14 +283,25 @@ find_window_number (int n)
}
rp_window *
-find_window_name (char *name)
+find_window_name (char *name, int exact_match)
{
rp_window_elem *cur;
- list_for_each_entry (cur, &rp_current_group->mapped_windows, node)
+ if (!exact_match)
{
- if (str_comp (name, window_name (cur->win), strlen (name)))
- return cur->win;
+ list_for_each_entry (cur, &rp_current_group->mapped_windows, node)
+ {
+ if (str_comp (name, window_name (cur->win), strlen (name)))
+ return cur->win;
+ }
+ }
+ else
+ {
+ list_for_each_entry (cur, &rp_current_group->mapped_windows, node)
+ {
+ if (!strcmp (name, window_name (cur->win)))
+ return cur->win;
+ }
}
/* didn't find it */