Discussion:
[PATCH] Workaround to avoid unzoom when clicking into a zoomed pane, for dragging and copying
Jose Antonio Delgado Alfonso
2015-04-26 13:13:42 UTC
Permalink
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
Nicholas Marriott
2015-04-26 20:14:59 UTC
Permalink
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);
}
Post by Jose Antonio Delgado Alfonso
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
https://lists.sourceforge.net/lists/listinfo/tmux-users
Jose Antonio Delgado Alfonso
2015-04-26 21:15:54 UTC
Permalink
This works for me.

Thanks.
Post by Nicholas Marriott
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);
}
Post by Jose Antonio Delgado Alfonso
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
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
https://lists.sourceforge.net/lists/listinfo/tmux-users
Nicholas Marriott
2015-04-27 07:50:10 UTC
Permalink
Applied to OpenBSD, will be in SF at the next sync. Thanks!
Post by Jose Antonio Delgado Alfonso
This works for me.
Thanks.
Post by Nicholas Marriott
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);
}
Post by Jose Antonio Delgado Alfonso
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
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
https://lists.sourceforge.net/lists/listinfo/tmux-users
Loading...