aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2015-04-27 07:49:36 +0000
committernicm <nicm>2015-04-27 07:49:36 +0000
commita70762c9b50e9d9249fa9a56233c0df4129c82fc (patch)
tree738be98fce47548b3254dc9cc2516b2b2604e512
parent5bd5c9c84e4bde3461a50f15e387c5e9fb78d7cb (diff)
downloadrtmux-a70762c9b50e9d9249fa9a56233c0df4129c82fc.tar.gz
rtmux-a70762c9b50e9d9249fa9a56233c0df4129c82fc.tar.bz2
rtmux-a70762c9b50e9d9249fa9a56233c0df4129c82fc.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).
-rw-r--r--cmd-select-pane.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index c84b4149..e7f2249e 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -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);
}