diff options
author | sabetts <sabetts> | 2000-08-31 02:38:10 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-08-31 02:38:10 +0000 |
commit | b86e0c298d6881fe1a79ab4bb592aefb47147817 (patch) | |
tree | 82154a33d2be3b801c7ae9d4443fc5480ef9a6f0 /events.c | |
parent | 51b0db69e403175301fc381dbad55357c1ca4622 (diff) | |
download | ratpoison-b86e0c298d6881fe1a79ab4bb592aefb47147817.zip |
Added an input_window to allow the user to type data. This is used to
jump to a window by name. Added functionality to jump to a window by name.
Diffstat (limited to 'events.c')
-rw-r--r-- | events.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -64,7 +64,8 @@ new_window (XCreateWindowEvent *e) s = find_screen (e->parent); win = find_window (e->window); - if (s && !win && e->window != s->key_window && e->window != s->bar_window) + if (s && !win && e->window != s->key_window && e->window != s->bar_window + && e->window != s->input_window) { win = add_to_window_list (s, e->window); win->state = STATE_UNMAPPED; @@ -82,6 +83,10 @@ unmap_notify (XEvent *ev) if (s && win) { + /* Give back the window number. the window will get another one, + if it in remapped. */ + return_window_number (win->number); + win->number = -1; win->state = STATE_UNMAPPED; update_window_names (s); } @@ -241,6 +246,17 @@ client_msg (XClientMessageEvent *ev) } static void +goto_win_by_name (screen_info *s) +{ + char winname[100]; + + get_input (s, "Window: ", winname, 100); + printf ("user entered: %s\n", winname); + + goto_window_name (winname); +} + +static void handle_key (screen_info *s) { int revert; @@ -293,6 +309,9 @@ handle_key (screen_info *s) case KEY_LASTWINDOW: last_window (); break; + case KEY_WINBYNAME: + goto_win_by_name (s); + break; case KEY_DELETE: if (ev.xkey.state & ShiftMask) kill_window (); else delete_window (); |