Please try this instead:

Index: cmd-select-pane.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/cmd-select-pane.c,v
retrieving revision 1.21
diff -u -p -r1.21 cmd-select-pane.c
--- cmd-select-pane.c   19 Apr 2015 21:05:27 -0000      1.21
+++ cmd-select-pane.c   26 Apr 2015 20:14:22 -0000
@@ -77,12 +77,6 @@ cmd_select_pane_exec(struct cmd *self, s
        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, s
                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);
        }


On Sun, Apr 26, 2015 at 03:13:42PM +0200, Jose Antonio Delgado Alfonso wrote:
> Issue: If you try to drag and copy using mouse in a zoomed panel, the
> select-pane function is executed before dragging, so panels will be
> unzoomed.
> Workaround: Removing the server_unzoom_window call from select-pane
> command fixes this issue, however, this is not the greatest solution. I
> would suggest to distinguish between mouse select-pane and keyboard
> select-pane.
> ---
>  cmd-select-pane.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/cmd-select-pane.c b/cmd-select-pane.c
> index c84b414..a4fc18e 100644
> --- a/cmd-select-pane.c
> +++ b/cmd-select-pane.c
> @@ -77,7 +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);
> -- 
> 2.3.6
> 
> 
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to