From 397ac095d10d0c2a89f91d254c4fef5c3bcaf929 Mon Sep 17 00:00:00 2001 From: sabetts Date: Fri, 15 Dec 2000 12:07:12 +0000 Subject: * actions.c (prev_window): No longer uses rp_current_window to keep track of state (next_window): No longer uses rp_current_window to keep track of state * actions.c (maximize): Adhere to the window's Size Hints --- src/actions.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index c9e06a1..3bb6bab 100644 --- a/src/actions.c +++ b/src/actions.c @@ -38,30 +38,37 @@ rp_action key_actions[] = { {KEY_PREFIX, 0, 0, generate_prefix}, void prev_window (void *data) { - if (rp_current_window != NULL) + rp_window *new_win = (rp_window *)data; + + if (new_win == NULL) new_win = rp_current_window; + if (new_win != NULL) { - set_current_window (rp_current_window->prev); - if (rp_current_window == NULL) + new_win = new_win->prev; + if (new_win == NULL) { - rp_current_window = rp_window_tail; + new_win = rp_window_tail; } - if (rp_current_window->state == STATE_UNMAPPED) prev_window (NULL); - set_active_window (rp_current_window); + if (new_win->state == STATE_UNMAPPED) prev_window (new_win); + set_active_window (new_win); } } + void next_window (void *data) { - if (rp_current_window != NULL) + rp_window *new_win = (rp_window *)data; + + if (new_win == NULL) new_win = rp_current_window; + if (new_win != NULL) { - rp_current_window = rp_current_window->next; - if (rp_current_window == NULL) + new_win = new_win->next; + if (new_win == NULL) { - rp_current_window = rp_window_head; + new_win = rp_window_head; } - if (rp_current_window->state == STATE_UNMAPPED) next_window (NULL); - set_active_window (rp_current_window); + if (new_win->state == STATE_UNMAPPED) next_window (new_win); + set_active_window (new_win); } } @@ -71,8 +78,7 @@ last_window (void *data) { rp_window *oldwin = rp_current_window; - rp_current_window = find_last_accessed_window (); - set_active_window (rp_current_window); + set_active_window (find_last_accessed_window ()); if (rp_current_window == oldwin) { @@ -234,8 +240,7 @@ goto_window_number (int n) return; } - rp_current_window = win; - set_active_window (rp_current_window); + set_active_window (win); } void -- cgit v1.2.3