diff options
author | sabetts <sabetts> | 2000-08-26 04:55:36 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-08-26 04:55:36 +0000 |
commit | 2a3c661689c276a3e441139f316689d6172a8ebb (patch) | |
tree | 380b956a60a4c0cf710034395159525c4aa5e0ea /list.c | |
parent | 592583e898157e6047412a398e33ed89b080e1d6 (diff) | |
download | ratpoison-2a3c661689c276a3e441139f316689d6172a8ebb.zip |
fixed up some last_window() bugs where ratpoison was not properly switching to
the last accessed window.
Diffstat (limited to 'list.c')
-rw-r--r-- | list.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -155,7 +155,16 @@ rp_window * find_last_accessed_window () { int last_access = 0; - rp_window *cur, *most_recent = NULL; + rp_window *cur, *most_recent; + + /* Find the first mapped window */ + for (most_recent = rp_window_head; most_recent; most_recent=most_recent->next) + { + if (most_recent->state == STATE_MAPPED) break; + } + + /* If there are no mapped windows, don't bother with the next part */ + if (most_recent == NULL) return NULL; for (cur=rp_window_head; cur; cur=cur->next) { @@ -164,7 +173,7 @@ find_last_accessed_window () && cur->state == STATE_MAPPED) { most_recent = cur; - last_access = most_recent->last_access; + last_access = cur->last_access; } } |