From 0509e1dbde7b246e1bfec177ecb451e57bde8788 Mon Sep 17 00:00:00 2001 From: "Bernhard R. Link" Date: Sat, 30 Jun 2012 15:03:45 +0200 Subject: cmd_info: also display a window not in the current group Without this change, cmd_info displays "No Window" if called with the current window not in the current group (for example directly after a gselect). This change makes it also look in other groups. In that case it might show a number not the one to switch back to it without switching the group first, but I guess that is less confusing than just claiming there is no window. --- src/actions.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/actions.c b/src/actions.c index b3baadb..bf381c8 100644 --- a/src/actions.c +++ b/src/actions.c @@ -4215,7 +4215,14 @@ cmd_info (int interactive UNUSED, struct cmdarg **args) win_elem = group_find_window (&rp_current_group->mapped_windows, win); if (!win_elem) win_elem = group_find_window (&rp_current_group->unmapped_windows, win); - + if (!win_elem) + { + rp_group *g = groups_find_group_by_window(win); + if (g != NULL) + win_elem = group_find_window (&g->mapped_windows, win); + if (!win_elem && g != NULL) + win_elem = group_find_window (&g->unmapped_windows, win); + } if (win_elem) { char *s; -- cgit v1.2.3