[PATCH] cmd_info: also display a window not in the current group

"Bernhard R. Link" <[email protected]>
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <[email protected]>
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;
-- 
1.7.10
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.