mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Change scroll/pane redraws to only redraw the single pane affected rather than
the entire window.
This commit is contained in:
parent
84cde92c8f
commit
dbf52facd2
6
CHANGES
6
CHANGES
@ -1,12 +1,12 @@
|
|||||||
02 April 2009
|
02 April 2009
|
||||||
|
|
||||||
|
* Change scroll/pane redraws to only redraw the single pane affected rather
|
||||||
|
than the entire window.
|
||||||
* If redrawing the region would mean redrawing > half the pane, just schedule
|
* If redrawing the region would mean redrawing > half the pane, just schedule
|
||||||
to redraw the entire window. Also add a flag to skip updating the window any
|
to redraw the entire window. Also add a flag to skip updating the window any
|
||||||
further if it is scheduled to be redrawn. This has the effect of batching
|
further if it is scheduled to be redrawn. This has the effect of batching
|
||||||
multiple redraws together.
|
multiple redraws together.
|
||||||
|
|
||||||
Redraws should be moved to the pane level later.
|
|
||||||
|
|
||||||
01 April 2009
|
01 April 2009
|
||||||
|
|
||||||
* Basic horizontal splitting and layout management. Still some redraw and other
|
* Basic horizontal splitting and layout management. Still some redraw and other
|
||||||
@ -1194,7 +1194,7 @@
|
|||||||
(including mutt, emacs). No status bar yet and no key remapping or other
|
(including mutt, emacs). No status bar yet and no key remapping or other
|
||||||
customisation.
|
customisation.
|
||||||
|
|
||||||
$Id: CHANGES,v 1.269 2009-04-02 20:30:17 nicm Exp $
|
$Id: CHANGES,v 1.270 2009-04-02 21:08:13 nicm Exp $
|
||||||
|
|
||||||
LocalWords: showw utf UTF fulvio ciriaco joshe OSC APC gettime abc DEF OA clr
|
LocalWords: showw utf UTF fulvio ciriaco joshe OSC APC gettime abc DEF OA clr
|
||||||
LocalWords: rivo nurges lscm Erdely eol smysession mysession ek dstname RB ms
|
LocalWords: rivo nurges lscm Erdely eol smysession mysession ek dstname RB ms
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: screen-redraw.c,v 1.33 2009-04-01 21:09:01 nicm Exp $ */
|
/* $Id: screen-redraw.c,v 1.34 2009-04-02 21:08:13 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -123,14 +123,24 @@ screen_redraw_screen(struct client *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw the pane. */
|
/* Draw the pane. */
|
||||||
for (i = 0; i < sy; i++)
|
screen_redraw_pane(c, wp);
|
||||||
tty_draw_line(tty, s, i, wp->xoff, wp->yoff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw the status line. */
|
/* Draw the status line. */
|
||||||
screen_redraw_status(c);
|
screen_redraw_status(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Draw a single pane. */
|
||||||
|
void
|
||||||
|
screen_redraw_pane(struct client *c, struct window_pane *wp)
|
||||||
|
{
|
||||||
|
u_int i;
|
||||||
|
|
||||||
|
for (i = 0; i < wp->sy; i++)
|
||||||
|
tty_draw_line(&c->tty, wp->screen, i, wp->xoff, wp->yoff);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Draw the status line. */
|
/* Draw the status line. */
|
||||||
void
|
void
|
||||||
screen_redraw_status(struct client *c)
|
screen_redraw_status(struct client *c)
|
||||||
|
26
server.c
26
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.135 2009-04-02 20:30:20 nicm Exp $ */
|
/* $Id: server.c,v 1.136 2009-04-02 21:08:13 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -481,6 +481,7 @@ void
|
|||||||
server_check_redraw(struct client *c)
|
server_check_redraw(struct client *c)
|
||||||
{
|
{
|
||||||
struct session *s;
|
struct session *s;
|
||||||
|
struct window_pane *wp;
|
||||||
char title[512];
|
char title[512];
|
||||||
int flags, redraw;
|
int flags, redraw;
|
||||||
|
|
||||||
@ -520,6 +521,11 @@ server_check_redraw(struct client *c)
|
|||||||
else
|
else
|
||||||
screen_redraw_screen(c);
|
screen_redraw_screen(c);
|
||||||
c->flags &= ~CLIENT_STATUS;
|
c->flags &= ~CLIENT_STATUS;
|
||||||
|
} else {
|
||||||
|
TAILQ_FOREACH(wp, &c->session->curw->window->panes, entry) {
|
||||||
|
if (wp->flags & PANE_REDRAW)
|
||||||
|
screen_redraw_pane(c, wp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->flags & CLIENT_STATUS)
|
if (c->flags & CLIENT_STATUS)
|
||||||
@ -603,6 +609,8 @@ void
|
|||||||
server_fill_clients(struct pollfd **pfd)
|
server_fill_clients(struct pollfd **pfd)
|
||||||
{
|
{
|
||||||
struct client *c;
|
struct client *c;
|
||||||
|
struct window *w;
|
||||||
|
struct window_pane *wp;
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||||
@ -632,6 +640,20 @@ server_fill_clients(struct pollfd **pfd)
|
|||||||
}
|
}
|
||||||
(*pfd)++;
|
(*pfd)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear any window redraw flags (will have been redrawn as part of *
|
||||||
|
* client).
|
||||||
|
*/
|
||||||
|
for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
|
||||||
|
w = ARRAY_ITEM(&windows, i);
|
||||||
|
if (w == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
w->flags &= ~WINDOW_REDRAW;
|
||||||
|
TAILQ_FOREACH(wp, &w->panes, entry)
|
||||||
|
wp->flags &= ~PANE_REDRAW;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle client pollfds. */
|
/* Handle client pollfds. */
|
||||||
@ -921,8 +943,6 @@ server_check_window(struct window *w)
|
|||||||
wp = wq;
|
wp = wq;
|
||||||
}
|
}
|
||||||
|
|
||||||
w->flags &= ~WINDOW_REDRAW; /* redrawn as part of client */
|
|
||||||
|
|
||||||
if (!destroyed)
|
if (!destroyed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
4
tmux.h
4
tmux.h
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.h,v 1.296 2009-04-02 20:30:20 nicm Exp $ */
|
/* $Id: tmux.h,v 1.297 2009-04-02 21:08:14 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -656,6 +656,7 @@ struct window_pane {
|
|||||||
int flags;
|
int flags;
|
||||||
#define PANE_HIDDEN 0x1
|
#define PANE_HIDDEN 0x1
|
||||||
#define PANE_RESTART 0x2
|
#define PANE_RESTART 0x2
|
||||||
|
#define PANE_REDRAW 0x4
|
||||||
|
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char *cwd;
|
char *cwd;
|
||||||
@ -1466,6 +1467,7 @@ void screen_write_cell(
|
|||||||
|
|
||||||
/* screen-redraw.c */
|
/* screen-redraw.c */
|
||||||
void screen_redraw_screen(struct client *);
|
void screen_redraw_screen(struct client *);
|
||||||
|
void screen_redraw_pane(struct client *, struct window_pane *);
|
||||||
void screen_redraw_status(struct client *);
|
void screen_redraw_status(struct client *);
|
||||||
|
|
||||||
/* screen.c */
|
/* screen.c */
|
||||||
|
6
tty.c
6
tty.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tty.c,v 1.91 2009-04-02 20:30:23 nicm Exp $ */
|
/* $Id: tty.c,v 1.92 2009-04-02 21:08:15 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -395,11 +395,9 @@ tty_redraw_region(struct tty *tty, struct window_pane *wp)
|
|||||||
* most cases, this is likely to be followed by some more scrolling -
|
* most cases, this is likely to be followed by some more scrolling -
|
||||||
* without this, the entire pane ends up being redrawn many times which
|
* without this, the entire pane ends up being redrawn many times which
|
||||||
* can be much more data.
|
* can be much more data.
|
||||||
*
|
|
||||||
* XXX Should just schedule to redraw this pane...
|
|
||||||
*/
|
*/
|
||||||
if (s->old_rupper - s->old_rlower >= screen_size_y(s) / 2) {
|
if (s->old_rupper - s->old_rlower >= screen_size_y(s) / 2) {
|
||||||
server_redraw_window(wp->window);
|
wp->flags |= PANE_REDRAW;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user