summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-11-19 00:52:53 +0000
committersabetts <sabetts>2004-11-19 00:52:53 +0000
commit3597d7d9eaff4d51b8825b9eea443ce7db86c733 (patch)
tree9a966e071deac20216c6f5958fc90f88d6b01874 /src
parent09221a12124bd6c3b13d23c85932a26cae57edac (diff)
downloadratpoison-3597d7d9eaff4d51b8825b9eea443ce7db86c733.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/actions.c16
-rw-r--r--src/window.c14
-rw-r--r--src/window.h2
3 files changed, 23 insertions, 9 deletions
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 ();