summaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-08-26 04:35:10 +0000
committersabetts <sabetts>2000-08-26 04:35:10 +0000
commit592583e898157e6047412a398e33ed89b080e1d6 (patch)
treed8560e0a118150bcfdb8b8ed3f132c8cb0ccf3a5 /list.c
parentd8a5963532fb35687bedee59f2235144f3930fbd (diff)
downloadratpoison-592583e898157e6047412a398e33ed89b080e1d6.zip
- 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 <window num>
Diffstat (limited to 'list.c')
-rw-r--r--list.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/list.c b/list.c
index ff38476..919aa5a 100644
--- a/list.c
+++ b/list.c
@@ -121,6 +121,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 ()
{
int last_access = 0;
@@ -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)
{