summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-select-pane.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-04-27 07:49:36 +0000
committernicm <nicm@openbsd.org>2015-04-27 07:49:36 +0000
commitdb3d5fb059cb08fd5915bbd003a0083e0712d2a6 (patch)
treefab7e3cb0ad5a78d731090667b9b59b8f1d0258e /usr.bin/tmux/cmd-select-pane.c
parentwith more unit convertion when new sensors will appear. (diff)
downloadwireguard-openbsd-db3d5fb059cb08fd5915bbd003a0083e0712d2a6.tar.xz
wireguard-openbsd-db3d5fb059cb08fd5915bbd003a0083e0712d2a6.zip
If the requested pane is already active, do not unzoom the window (or do
anything else). Prevents mouse clicking when zoomed causing unzoom, reported by Jose Antonio Delgado Alfonso (with a different fix).
Diffstat (limited to 'usr.bin/tmux/cmd-select-pane.c')
-rw-r--r--usr.bin/tmux/cmd-select-pane.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index efaac9a38ed..e8f50d39abd 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.21 2015/04/19 21:05:27 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.22 2015/04/27 07:49:36 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -77,12 +77,6 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp)) == NULL)
return (CMD_RETURN_ERROR);
- server_unzoom_window(wp->window);
- if (!window_pane_visible(wp)) {
- cmdq_error(cmdq, "pane not visible");
- return (CMD_RETURN_ERROR);
- }
-
if (args_has(self->args, 'P') || args_has(self->args, 'g')) {
if (args_has(args, 'P')) {
style = args_get(args, 'P');
@@ -111,11 +105,23 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
- if (args_has(self->args, 'e'))
+ if (args_has(self->args, 'e')) {
wp->flags &= ~PANE_INPUTOFF;
- else if (args_has(self->args, 'd'))
+ return (CMD_RETURN_NORMAL);
+ }
+ if (args_has(self->args, 'd')) {
wp->flags |= PANE_INPUTOFF;
- else if (window_set_active_pane(wl->window, wp)) {
+ return (CMD_RETURN_NORMAL);
+ }
+
+ if (wp == wl->window->active)
+ return (CMD_RETURN_NORMAL);
+ server_unzoom_window(wp->window);
+ if (!window_pane_visible(wp)) {
+ cmdq_error(cmdq, "pane not visible");
+ return (CMD_RETURN_ERROR);
+ }
+ if (window_set_active_pane(wl->window, wp)) {
server_status_window(wl->window);
server_redraw_window_borders(wl->window);
}