=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.72 retrieving revision 1.73 diff -c -r1.72 -r1.73 *** src/usr.bin/tmux/status.c 2011/03/29 19:30:16 1.72 --- src/usr.bin/tmux/status.c 2011/04/18 19:49:05 1.73 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.72 2011/03/29 19:30:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.73 2011/04/18 19:49:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 120,125 **** --- 120,142 ---- return (right); } + /* Set window at window list position. */ + void + status_set_window_at(struct client *c, u_int x) + { + struct session *s = c->session; + struct winlink *wl; + + x += s->wlmouse; + RB_FOREACH(wl, winlinks, &s->windows) { + if (x < wl->status_width && + session_select(s, wl->idx) == 0) { + server_redraw_session(s); + } + x -= wl->status_width + 1; + } + } + /* Draw status for client on the last lines of given context. */ int status_redraw(struct client *c) *************** *** 325,330 **** --- 342,348 ---- wloffset++; /* Copy the window list. */ + s->wlmouse = -wloffset + wlstart; screen_write_cursormove(&ctx, wloffset, 0); screen_write_copy(&ctx, &window_list, wlstart, 0, wlwidth, 1); screen_free(&window_list);