diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/actions.c | 2 | ||||
-rw-r--r-- | src/events.c | 2 | ||||
-rw-r--r-- | src/group.c | 15 | ||||
-rw-r--r-- | src/group.h | 2 | ||||
-rw-r--r-- | src/split.c | 4 | ||||
-rw-r--r-- | src/window.c | 6 | ||||
-rw-r--r-- | src/window.h | 2 |
8 files changed, 28 insertions, 16 deletions
@@ -1,3 +1,14 @@ +2004-11-02 Shawn Betts <katia_dilkina@verizon.net> + + * src/group.c (group_last_window): add argument, the screen to find the + window in. All callers updated. + (group_prev_window): make sure the matched window is in the same + screen as win. + (group_next_window): likewise + + * src/window.c (find_window_other): add argument, the screen to + find the window in. All callers updated. + 2004-10-29 Shawn Betts <katia_dilkina@verizon.net> * contrib/rpws: remove the echo /tmp/boom line. diff --git a/src/actions.c b/src/actions.c index b5cec27..6040d96 100644 --- a/src/actions.c +++ b/src/actions.c @@ -919,7 +919,7 @@ cmd_other (int interactive, char *data) rp_window *w; /* w = find_window_other (); */ - w = group_last_window (rp_current_group); + w = group_last_window (rp_current_group, current_screen()); if (!w) message (MESSAGE_NO_OTHER_WINDOW); diff --git a/src/events.c b/src/events.c index 8005a26..7e05a7e 100644 --- a/src/events.c +++ b/src/events.c @@ -346,7 +346,7 @@ client_msg (XClientMessageEvent *ev) PRINT_DEBUG (("Iconify Request.\n")); if (win->state == NormalState) { - rp_window *w = find_window_other(); + rp_window *w = find_window_other(win->scr); if (w) set_active_window (w); diff --git a/src/group.c b/src/group.c index ab95d2f..883e7d8 100644 --- a/src/group.c +++ b/src/group.c @@ -318,12 +318,11 @@ groups_del_window (rp_window *win) } rp_window * -group_last_window (rp_group *g) +group_last_window (rp_group *g, rp_screen *s) { int last_access = 0; rp_window_elem *most_recent = NULL; rp_window_elem *cur; - rp_screen *s = current_screen(); list_for_each_entry (cur, &g->mapped_windows, node) { @@ -350,13 +349,13 @@ group_next_window (rp_group *g, rp_window *win) /* If there is no window, then get the last accessed one. */ if (win == NULL) - return group_last_window (g); + return group_last_window (g, current_screen()); /* If we can't find the window, then it's in a different group, so get the last accessed one in this group. */ we = group_find_window (&g->mapped_windows, win); if (we == NULL) - return group_last_window (g); + return group_last_window (g, win->scr); /* The window is in this group, so find the next one in the list that isn't already displayed. */ @@ -364,7 +363,7 @@ group_next_window (rp_group *g, rp_window *win) cur != we; cur = list_next_entry (cur, &g->mapped_windows, node)) { - if (!find_windows_frame (cur->win) && (cur->win->scr == current_screen() || rp_have_xinerama)) + if (!find_windows_frame (cur->win) && (cur->win->scr == win->scr || rp_have_xinerama)) { return cur->win; } @@ -380,13 +379,13 @@ group_prev_window (rp_group *g, rp_window *win) /* If there is no window, then get the last accessed one. */ if (win == NULL) - return group_last_window (g); + return group_last_window (g, current_screen()); /* If we can't find the window, then it's in a different group, so get the last accessed one in this group. */ we = group_find_window (&g->mapped_windows, win); if (we == NULL) - return group_last_window (g); + return group_last_window (g, win->scr); /* The window is in this group, so find the previous one in the list that isn't already displayed. */ @@ -394,7 +393,7 @@ group_prev_window (rp_group *g, rp_window *win) cur != we; cur = list_prev_entry (cur, &g->mapped_windows, node)) { - if (!find_windows_frame (cur->win) && (cur->win->scr == current_screen() || rp_have_xinerama)) + if (!find_windows_frame (cur->win) && (cur->win->scr == win->scr || rp_have_xinerama)) { return cur->win; } diff --git a/src/group.h b/src/group.h index 781c2ea..7678bbb 100644 --- a/src/group.h +++ b/src/group.h @@ -24,7 +24,7 @@ rp_window *group_next_window (rp_group *g, rp_window *win); rp_group *groups_find_group_by_name (char *s); rp_group *groups_find_group_by_number (int n); -rp_window *group_last_window (rp_group *g); +rp_window *group_last_window (rp_group *g, rp_screen *screen); rp_group *group_prev_group (); rp_group *group_next_group (); diff --git a/src/split.c b/src/split.c index 086c645..2553bfb 100644 --- a/src/split.c +++ b/src/split.c @@ -66,8 +66,10 @@ cleanup_frame (rp_frame *frame) { rp_window *last_win; rp_window *win; + rp_screen *screen; + screen = frames_screen(frame); - win = find_window_other (); + win = find_window_other (screen); if (win == NULL) { set_frames_window (frame, NULL); diff --git a/src/window.c b/src/window.c index 8e71afb..a286676 100644 --- a/src/window.c +++ b/src/window.c @@ -266,9 +266,9 @@ find_window_next (rp_window *w) } rp_window * -find_window_other () +find_window_other (rp_screen *screen) { - return group_last_window (rp_current_group); + return group_last_window (rp_current_group, screen); } @@ -652,7 +652,7 @@ get_window_list (char *fmt, char *delim, struct sbuf *buffer, if (buffer == NULL) return; sbuf_clear (buffer); - other_window = find_window_other (); + other_window = find_window_other (current_screen()); /* We only loop through the current group to look for windows. */ list_for_each_entry (we,&rp_current_group->mapped_windows,node) diff --git a/src/window.h b/src/window.h index ac26881..e93c7f3 100644 --- a/src/window.h +++ b/src/window.h @@ -45,7 +45,7 @@ int is_transient_ancestor (rp_window *win, rp_window *transient_for); #endif /* int goto_window_name (char *name); */ -rp_window *find_window_other (); +rp_window *find_window_other (rp_screen *screen); rp_window *find_window_by_number (int n); rp_window *find_window_name (char *name); rp_window *find_window_prev (rp_window *w); |