From 592583e898157e6047412a398e33ed89b080e1d6 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sat, 26 Aug 2000 04:35:10 +0000 Subject: - Fixed some of the X_SetInputFocus bugs that were crashing ratpoison. - Now responds to Raise and Lower X events (fixes the C-x 5 o bug with emacs) - Added numbers to each window and the ability to jump to that window by hitting Prefix --- list.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'list.c') diff --git a/list.c b/list.c index ff38476..919aa5a 100644 --- a/list.c +++ b/list.c @@ -120,6 +120,37 @@ prev_window () } } +rp_window * +find_window_by_number (int n) +{ + int i; + rp_window *cur; + + for (i=0, cur=rp_window_head; cur; cur=cur->next) + { + if (cur->state != STATE_MAPPED) continue; + + if (i == n) return cur; + else i++; + } + + return NULL; +} + +void +goto_window_number (int n) +{ + rp_window *win; + + if ((win = find_window_by_number (n)) == NULL) + { + return; + } + + rp_current_window = win; + set_active_window (rp_current_window); +} + rp_window * find_last_accessed_window () { @@ -128,7 +159,7 @@ find_last_accessed_window () for (cur=rp_window_head; cur; cur=cur->next) { - if (cur->last_access > last_access + if (cur->last_access >= last_access && cur != rp_current_window && cur->state == STATE_MAPPED) { -- cgit v1.2.3