summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/actions.c16
-rw-r--r--src/window.c14
-rw-r--r--src/window.h2
4 files changed, 30 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a90b8c3..efd0d8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2004-11-18 Shawn Betts <katia_dilkina@verizon.net>
+ * src/window.c (print_window_information): add argument,
+ group. print the window's number in the group. All callers
+ updated.
+
+ * src/actions.c (cmd_info): print the window's number in the
+ current group.
+
* src/window.c (unhide_transient_for): add a newline to debugging
output.
(hide_transient_for_between): likewise.
diff --git a/src/actions.c b/src/actions.c
index df2ae02..e334de1 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1443,7 +1443,7 @@ cmd_number (int interactive, char *data)
if (data == NULL)
{
- print_window_information (current_window());
+ print_window_information (rp_current_group, current_window());
return NULL;
}
@@ -1463,10 +1463,10 @@ cmd_number (int interactive, char *data)
else
{
/* Impossible, but we'll live with it. */
- print_window_information (current_window());
+ print_window_information (rp_current_group, current_window());
free (str);
return NULL;
- }
+ }
/* Get the rest of the string and see if the user specified a target
window. */
@@ -2933,8 +2933,14 @@ cmd_info (int interactive, char *data)
else
{
rp_window *win = current_window();
- marked_message_printf (0, 0, " (%d,%d) %d(%s) %s", win->width, win->height,
- win->number, window_name (win), win->transient ? "Transient ":"");
+ rp_window_elem *win_elem;
+ win_elem = group_find_window (&rp_current_group->mapped_windows, win);
+ if (win_elem)
+ marked_message_printf (0, 0, " (%d,%d) %d(%s) %s", win->width, win->height,
+ win_elem->number, window_name (win), win->transient ? "Transient ":"");
+ else
+ marked_message_printf (0, 0, " (%d,%d) (%s) %s", win->width, win->height,
+ window_name (win), win->transient ? "Transient ":"");
}
return NULL;
diff --git a/src/window.c b/src/window.c
index 0ce8239..68e5963 100644
--- a/src/window.c
+++ b/src/window.c
@@ -529,10 +529,18 @@ goto_window (rp_window *win)
}
void
-print_window_information (rp_window *win)
+print_window_information (rp_group *group, rp_window *win)
{
- marked_message_printf (0, 0, MESSAGE_WINDOW_INFORMATION,
- win->number, window_name (win));
+ rp_window_elem *win_elem;
+ /* Display the window's number in group. This gives the possibility
+ of windows existing in multiple groups. */
+ win_elem = group_find_window (&group->mapped_windows, win);
+ if (win_elem)
+ marked_message_printf (0, 0, MESSAGE_WINDOW_INFORMATION,
+ win_elem->number, window_name (win));
+ else
+ marked_message_printf (0, 0, "%s doesn't exist in group %d\n",
+ window_name(win), group->number);
}
/* format options
diff --git a/src/window.h b/src/window.h
index e93c7f3..874de05 100644
--- a/src/window.h
+++ b/src/window.h
@@ -57,7 +57,7 @@ void sort_window_list_by_number ();
void insert_into_list (rp_window *win, struct list_head *list);
-void print_window_information (rp_window *win);
+void print_window_information (rp_group *group, rp_window *win);
void get_window_list (char *fmt, char *delim, struct sbuf *buffer,
int *mark_start, int *mark_end);
void init_window_stuff ();