mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-27 02:23:15 +01:00
Clear clients with flag too.
This commit is contained in:
parent
77224aaf8b
commit
958069575d
12
resize.c
12
resize.c
@ -1,4 +1,4 @@
|
||||
/* $Id: resize.c,v 1.12 2008-06-06 20:02:27 nicm Exp $ */
|
||||
/* $Id: resize.c,v 1.13 2008-06-07 07:13:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -121,8 +121,14 @@ recalculate_sizes(void)
|
||||
log_debug("window size %u,%u (was %u,%u)", ssx, ssy,
|
||||
screen_size_x(&w->base), screen_size_y(&w->base));
|
||||
|
||||
server_clear_window(w);
|
||||
window_resize(w, ssx, ssy);
|
||||
server_redraw_window(w);
|
||||
|
||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||
c = ARRAY_ITEM(&clients, i);
|
||||
if (c == NULL || c->session == NULL)
|
||||
continue;
|
||||
if (c->session->curw->window == w)
|
||||
c->flags |= (CLIENT_CLEAR|CLIENT_REDRAW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
server-fn.c
41
server-fn.c
@ -1,4 +1,4 @@
|
||||
/* $Id: server-fn.c,v 1.39 2008-06-07 06:47:38 nicm Exp $ */
|
||||
/* $Id: server-fn.c,v 1.40 2008-06-07 07:13:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -71,19 +71,6 @@ server_write_window(
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
server_clear_client(struct client *c)
|
||||
{
|
||||
struct screen_redraw_ctx ctx;
|
||||
|
||||
screen_redraw_start_client(&ctx, c);
|
||||
screen_redraw_set_attributes(&ctx, SCREEN_DEFATTR, SCREEN_DEFCOLR);
|
||||
screen_redraw_clear_screen(&ctx);
|
||||
screen_redraw_stop(&ctx);
|
||||
|
||||
status_write_client(c);
|
||||
}
|
||||
|
||||
void
|
||||
server_redraw_client(struct client *c)
|
||||
{
|
||||
@ -96,19 +83,6 @@ server_status_client(struct client *c)
|
||||
c->flags |= CLIENT_STATUS;
|
||||
}
|
||||
|
||||
void
|
||||
server_clear_session(struct session *s)
|
||||
{
|
||||
struct screen_redraw_ctx ctx;
|
||||
|
||||
screen_redraw_start_session(&ctx, s);
|
||||
screen_redraw_set_attributes(&ctx, SCREEN_DEFATTR, SCREEN_DEFCOLR);
|
||||
screen_redraw_clear_screen(&ctx);
|
||||
screen_redraw_stop(&ctx);
|
||||
|
||||
status_write_session(s);
|
||||
}
|
||||
|
||||
void
|
||||
server_redraw_session(struct session *s)
|
||||
{
|
||||
@ -139,19 +113,6 @@ server_status_session(struct session *s)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
server_clear_window(struct window *w)
|
||||
{
|
||||
struct screen_redraw_ctx ctx;
|
||||
|
||||
screen_redraw_start_window(&ctx, w);
|
||||
screen_redraw_set_attributes(&ctx, SCREEN_DEFATTR, SCREEN_DEFCOLR);
|
||||
screen_redraw_clear_screen(&ctx);
|
||||
screen_redraw_stop(&ctx);
|
||||
|
||||
status_write_window(w);
|
||||
}
|
||||
|
||||
void
|
||||
server_redraw_window(struct window *w)
|
||||
{
|
||||
|
13
server.c
13
server.c
@ -1,4 +1,4 @@
|
||||
/* $Id: server.c,v 1.57 2008-06-07 06:47:38 nicm Exp $ */
|
||||
/* $Id: server.c,v 1.58 2008-06-07 07:13:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -275,9 +275,18 @@ void
|
||||
server_check_redraw(struct client *c)
|
||||
{
|
||||
struct screen_redraw_ctx ctx;
|
||||
struct screen screen;
|
||||
|
||||
if (c == NULL || c->session == NULL)
|
||||
return;
|
||||
|
||||
if (c->flags & CLIENT_CLEAR) {
|
||||
screen_create(&screen, c->sx, c->sy - 1, 0);
|
||||
screen_redraw_start(&ctx, &screen, tty_write_client, c);
|
||||
screen_redraw_clear_screen(&ctx);
|
||||
screen_redraw_stop(&ctx);
|
||||
screen_destroy(&screen);
|
||||
}
|
||||
|
||||
if (c->flags & CLIENT_REDRAW) {
|
||||
screen_redraw_start_client(&ctx, c);
|
||||
@ -287,7 +296,7 @@ server_check_redraw(struct client *c)
|
||||
} else if (c->flags & CLIENT_STATUS)
|
||||
status_write_client(c);
|
||||
|
||||
c->flags &= ~(CLIENT_REDRAW|CLIENT_STATUS);
|
||||
c->flags &= ~(CLIENT_CLEAR|CLIENT_REDRAW|CLIENT_STATUS);
|
||||
}
|
||||
|
||||
/* Check for status line redraw on client. */
|
||||
|
6
tmux.h
6
tmux.h
@ -1,4 +1,4 @@
|
||||
/* $Id: tmux.h,v 1.137 2008-06-07 06:47:38 nicm Exp $ */
|
||||
/* $Id: tmux.h,v 1.138 2008-06-07 07:13:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -651,6 +651,7 @@ struct client {
|
||||
#define CLIENT_MOUSE 0x4
|
||||
#define CLIENT_REDRAW 0x8
|
||||
#define CLIENT_STATUS 0x10
|
||||
#define CLIENT_CLEAR 0x20
|
||||
int flags;
|
||||
|
||||
struct session *session;
|
||||
@ -908,13 +909,10 @@ void server_write_session(
|
||||
struct session *, enum hdrtype, const void *, size_t);
|
||||
void server_write_window(
|
||||
struct window *, enum hdrtype, const void *, size_t);
|
||||
void server_clear_client(struct client *);
|
||||
void server_redraw_client(struct client *);
|
||||
void server_status_client(struct client *);
|
||||
void server_clear_session(struct session *);
|
||||
void server_redraw_session(struct session *);
|
||||
void server_status_session(struct session *);
|
||||
void server_clear_window(struct window *);
|
||||
void server_redraw_window(struct window *);
|
||||
void server_status_window(struct window *);
|
||||
void printflike2 server_write_message(struct client *, const char *, ...);
|
||||
|
Loading…
Reference in New Issue
Block a user