Re: [PATCH] Restore zoom when selecting a previously zoomed pane

2013-12-10 Thread Nicholas Marriott
Well, we could add a format to say if the window was/is zoomed
(#{pane_was_zoomed} maybe).

Even a flag to selectp to do the behaviour you want (selectp -Z) might
be okay.

So if you want to add one or both of those?

Cheers


On Mon, Nov 25, 2013 at 11:14:54PM +0100, Maykel Moya wrote:
 On 24/11/13 12:36, Nicholas Marriott wrote:
 
  Hi
  
  I tried this and honestly I don't like it, I think it is unexpected that
  if I do splitw and the pane unzooms it then zooms again when I select
  it. It's better for the pane not to secretly stay zoomed - it isn't so
  hard to zoom it again if that's what you want.
 
 Hello Nicholas
 
 First of all thank you for taking the time to test the patch.
 
 I admit that autozooming on enter is not much aligned with the principle
 of least surprise. In fact I wasn't displaying the window flags in the
 status bar and after aplying the patch I added it so I can know if the
 current window is zoomed or not.
 
 That said, I still find useful this behaviour. Typical use case is
 editor+shell. You go from your maximized editor pane to the shell, try
 something and then go back to edit, and then again to the shell and so on.
 
 It can be done manually, of course, in fact my first take was the one I
 commented in my first mail: bind h select-pane -L and bind H
 select-pane -L \; resize-pane -Z.
 
 I find some equivalence between this autozoom and the GUI's popular
 metaphor in which you push a window toward a lateral side and the window
 is resized to take that lateral half of the screen. If you drag the
 window again to the center, it it resized back to its previous size
 instead of keeping it half-screen size.
 
 Outside of tmux the only way I can think of to know if a pane was
 previously zoomed is to have an app listening for %layout-change
 messages an keeping it's own internal state. Any other idea is welcomed.
 
 Question aside: is there any plan for a libtmux ?
 
 Thanks
 
 Regards,
 maykel
 
 
 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing 
 conversations that shape the rapidly evolving mobile landscape. Sign up now. 
 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 tmux-users mailing list
 tmux-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/tmux-users

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: [PATCH] Restore zoom when selecting a previously zoomed pane

2013-11-25 Thread Maykel Moya
On 24/11/13 12:36, Nicholas Marriott wrote:

 Hi
 
 I tried this and honestly I don't like it, I think it is unexpected that
 if I do splitw and the pane unzooms it then zooms again when I select
 it. It's better for the pane not to secretly stay zoomed - it isn't so
 hard to zoom it again if that's what you want.

Hello Nicholas

First of all thank you for taking the time to test the patch.

I admit that autozooming on enter is not much aligned with the principle
of least surprise. In fact I wasn't displaying the window flags in the
status bar and after aplying the patch I added it so I can know if the
current window is zoomed or not.

That said, I still find useful this behaviour. Typical use case is
editor+shell. You go from your maximized editor pane to the shell, try
something and then go back to edit, and then again to the shell and so on.

It can be done manually, of course, in fact my first take was the one I
commented in my first mail: bind h select-pane -L and bind H
select-pane -L \; resize-pane -Z.

I find some equivalence between this autozoom and the GUI's popular
metaphor in which you push a window toward a lateral side and the window
is resized to take that lateral half of the screen. If you drag the
window again to the center, it it resized back to its previous size
instead of keeping it half-screen size.

Outside of tmux the only way I can think of to know if a pane was
previously zoomed is to have an app listening for %layout-change
messages an keeping it's own internal state. Any other idea is welcomed.

Question aside: is there any plan for a libtmux ?

Thanks

Regards,
maykel


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: [PATCH] Restore zoom when selecting a previously zoomed pane

2013-11-24 Thread Nicholas Marriott
Hi

I tried this and honestly I don't like it, I think it is unexpected that
if I do splitw and the pane unzooms it then zooms again when I select
it. It's better for the pane not to secretly stay zoomed - it isn't so
hard to zoom it again if that's what you want.


On Sat, Nov 16, 2013 at 04:38:59PM +0100, Maykel Moya wrote:
 Signed-off-by: Maykel Moya mm...@mmoya.org
 ---
  cmd-resize-pane.c |  7 +--
  cmd-select-pane.c | 10 --
  tmux.h|  1 +
  3 files changed, 14 insertions(+), 4 deletions(-)
 
 diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c
 index d31f886..d8ee076 100644
 --- a/cmd-resize-pane.c
 +++ b/cmd-resize-pane.c
 @@ -101,10 +101,13 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_q 
 *cmdq)
   w = wl-window;
  
   if (args_has(args, 'Z')) {
 - if (w-flags  WINDOW_ZOOMED)
 + if (w-flags  WINDOW_ZOOMED) {
   window_unzoom(w);
 - else
 + wp-flags = ~PANE_ZOOMED;
 + } else {
   window_zoom(wp);
 + wp-flags |= PANE_ZOOMED;
 + }
   server_redraw_window(w);
   server_status_window(w);
   return (CMD_RETURN_NORMAL);
 diff --git a/cmd-select-pane.c b/cmd-select-pane.c
 index c342fef..89cfb82 100644
 --- a/cmd-select-pane.c
 +++ b/cmd-select-pane.c
 @@ -109,8 +109,14 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q 
 *cmdq)
   }
  
   window_set_active_pane(wl-window, wp);
 - server_status_window(wl-window);
 - server_redraw_window_borders(wl-window);
 + if (wp-flags  PANE_ZOOMED) {
 + window_zoom(wp);
 + server_redraw_window(wl-window);
 + server_status_window(wl-window);
 + } else {
 + server_status_window(wl-window);
 + server_redraw_window_borders(wl-window);
 + }
  
   return (CMD_RETURN_NORMAL);
  }
 diff --git a/tmux.h b/tmux.h
 index dbc2c49..425e000 100644
 --- a/tmux.h
 +++ b/tmux.h
 @@ -904,6 +904,7 @@ struct window_pane {
  #define PANE_FOCUSED 0x4
  #define PANE_RESIZE 0x8
  #define PANE_FOCUSPUSH 0x10
 +#define PANE_ZOOMED 0x20
  
   char*cmd;
   char*shell;
 -- 
 1.8.3.2
 
 
 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 tmux-users mailing list
 tmux-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/tmux-users

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


[PATCH] Restore zoom when selecting a previously zoomed pane

2013-11-16 Thread Maykel Moya
Signed-off-by: Maykel Moya mm...@mmoya.org
---
 cmd-resize-pane.c |  7 +--
 cmd-select-pane.c | 10 --
 tmux.h|  1 +
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c
index d31f886..d8ee076 100644
--- a/cmd-resize-pane.c
+++ b/cmd-resize-pane.c
@@ -101,10 +101,13 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_q *cmdq)
w = wl-window;
 
if (args_has(args, 'Z')) {
-   if (w-flags  WINDOW_ZOOMED)
+   if (w-flags  WINDOW_ZOOMED) {
window_unzoom(w);
-   else
+   wp-flags = ~PANE_ZOOMED;
+   } else {
window_zoom(wp);
+   wp-flags |= PANE_ZOOMED;
+   }
server_redraw_window(w);
server_status_window(w);
return (CMD_RETURN_NORMAL);
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index c342fef..89cfb82 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -109,8 +109,14 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
}
 
window_set_active_pane(wl-window, wp);
-   server_status_window(wl-window);
-   server_redraw_window_borders(wl-window);
+   if (wp-flags  PANE_ZOOMED) {
+   window_zoom(wp);
+   server_redraw_window(wl-window);
+   server_status_window(wl-window);
+   } else {
+   server_status_window(wl-window);
+   server_redraw_window_borders(wl-window);
+   }
 
return (CMD_RETURN_NORMAL);
 }
diff --git a/tmux.h b/tmux.h
index dbc2c49..425e000 100644
--- a/tmux.h
+++ b/tmux.h
@@ -904,6 +904,7 @@ struct window_pane {
 #define PANE_FOCUSED 0x4
 #define PANE_RESIZE 0x8
 #define PANE_FOCUSPUSH 0x10
+#define PANE_ZOOMED 0x20
 
char*cmd;
char*shell;
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users