diff options
author | sabetts <sabetts> | 2000-12-15 12:07:12 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-12-15 12:07:12 +0000 |
commit | 397ac095d10d0c2a89f91d254c4fef5c3bcaf929 (patch) | |
tree | c54441ed5d52fffb8df914d19716b68b96e3cb28 /src/actions.c | |
parent | a4cd77bff858bbe63c46399e0c848d805177175a (diff) | |
download | ratpoison-397ac095d10d0c2a89f91d254c4fef5c3bcaf929.zip |
* 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
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 37 |
1 files changed, 21 insertions, 16 deletions
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 |