mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
|PatchSet 893
|Date: 2011/04/18 20:49:05 |Author: nicm |Branch: HEAD |Tag: (none) |Log: |Add an option (mouse-select-window) which allows the mouse to be used by |clicking on the status line, written by hsim at gmx dot li.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: server-client.c,v 1.55 2011-04-06 22:21:02 nicm Exp $ */
|
||||
/* $Id: server-client.c,v 1.56 2011-04-18 21:07:58 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -318,6 +318,12 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data)
|
||||
server_redraw_window_borders(w);
|
||||
wp = w->active;
|
||||
}
|
||||
if (mouse->y + 1 == c->tty.sy && mouse->b == MOUSE_UP &&
|
||||
options_get_number(oo, "mouse-select-window") &&
|
||||
options_get_number(oo, "status")) {
|
||||
status_set_window_at(c, mouse->x);
|
||||
return;
|
||||
}
|
||||
window_pane_mouse(wp, c->session, mouse);
|
||||
return;
|
||||
}
|
||||
@ -458,6 +464,10 @@ server_client_reset_state(struct client *c)
|
||||
(mode & ALL_MOUSE_MODES) == 0)
|
||||
mode |= MODE_MOUSE_STANDARD;
|
||||
|
||||
if (options_get_number(oo, "mouse-select-window") &&
|
||||
(mode & ALL_MOUSE_MODES) == 0)
|
||||
mode |= MODE_MOUSE_STANDARD;
|
||||
|
||||
/*
|
||||
* Set UTF-8 mouse input if required. If the terminal is UTF-8, the
|
||||
* user has set mouse-utf8 and any mouse mode is in effect, turn on
|
||||
|
Reference in New Issue
Block a user