"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "window.c" between
tmux-3.2.tar.gz and tmux-3.2a.tar.gz

About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.

window.c  (tmux-3.2):window.c  (tmux-3.2a)
skipping to change at line 332 skipping to change at line 332
w->options = options_create(global_w_options); w->options = options_create(global_w_options);
w->references = 0; w->references = 0;
TAILQ_INIT(&w->winlinks); TAILQ_INIT(&w->winlinks);
w->id = next_window_id++; w->id = next_window_id++;
RB_INSERT(windows, &windows, w); RB_INSERT(windows, &windows, w);
window_update_activity(w); window_update_activity(w);
log_debug("%s: @%u create %ux%u (%ux%u)", __func__, w->id, sx, sy,
w->xpixel, w->ypixel);
return (w); return (w);
} }
static void static void
window_destroy(struct window *w) window_destroy(struct window *w)
{ {
log_debug("window @%u destroyed (%d references)", w->id, w->references); log_debug("window @%u destroyed (%d references)", w->id, w->references);
RB_REMOVE(windows, &windows, w); RB_REMOVE(windows, &windows, w);
skipping to change at line 426 skipping to change at line 428
ypixel == -1 ? w->ypixel : (u_int)ypixel); ypixel == -1 ? w->ypixel : (u_int)ypixel);
w->sx = sx; w->sx = sx;
w->sy = sy; w->sy = sy;
if (xpixel != -1) if (xpixel != -1)
w->xpixel = xpixel; w->xpixel = xpixel;
if (ypixel != -1) if (ypixel != -1)
w->ypixel = ypixel; w->ypixel = ypixel;
} }
void void
window_pane_send_resize(struct window_pane *wp, int force) window_pane_send_resize(struct window_pane *wp, u_int sx, u_int sy)
{ {
struct window *w = wp->window; struct window *w = wp->window;
struct winsize ws; struct winsize ws;
u_int sy;
if (wp->fd == -1) if (wp->fd == -1)
return; return;
if (!force) log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, sx, sy);
sy = wp->sy;
else if (wp->sy <= 1)
sy = wp->sy + 1;
else
sy = wp->sy - 1;
log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, sy);
memset(&ws, 0, sizeof ws); memset(&ws, 0, sizeof ws);
ws.ws_col = wp->sx; ws.ws_col = sx;
ws.ws_row = sy; ws.ws_row = sy;
ws.ws_xpixel = w->xpixel * ws.ws_col; ws.ws_xpixel = w->xpixel * ws.ws_col;
ws.ws_ypixel = w->ypixel * ws.ws_row; ws.ws_ypixel = w->ypixel * ws.ws_row;
if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1) if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
#ifdef __sun #ifdef __sun
/* /*
* Some versions of Solaris apparently can return an error when * Some versions of Solaris apparently can return an error when
* resizing; don't know why this happens, can't reproduce on * resizing; don't know why this happens, can't reproduce on
* other platforms and ignoring it doesn't seem to cause any * other platforms and ignoring it doesn't seem to cause any
* issues. * issues.
skipping to change at line 868 skipping to change at line 863
char host[HOST_NAME_MAX + 1]; char host[HOST_NAME_MAX + 1];
wp = xcalloc(1, sizeof *wp); wp = xcalloc(1, sizeof *wp);
wp->window = w; wp->window = w;
wp->options = options_create(w->options); wp->options = options_create(w->options);
wp->flags = PANE_STYLECHANGED; wp->flags = PANE_STYLECHANGED;
wp->id = next_window_pane_id++; wp->id = next_window_pane_id++;
RB_INSERT(window_pane_tree, &all_window_panes, wp); RB_INSERT(window_pane_tree, &all_window_panes, wp);
wp->argc = 0;
wp->argv = NULL;
wp->shell = NULL;
wp->cwd = NULL;
wp->fd = -1; wp->fd = -1;
wp->event = NULL;
wp->fg = 8; wp->fg = 8;
wp->bg = 8; wp->bg = 8;
TAILQ_INIT(&wp->modes); TAILQ_INIT(&wp->modes);
wp->layout_cell = NULL; TAILQ_INIT (&wp->resize_queue);
wp->xoff = 0;
wp->yoff = 0;
wp->sx = sx; wp->sx = sx;
wp->sy = sy; wp->sy = sy;
wp->pipe_fd = -1; wp->pipe_fd = -1;
wp->pipe_event = NULL;
screen_init(&wp->base, sx, sy, hlimit); screen_init(&wp->base, sx, sy, hlimit);
wp->screen = &wp->base; wp->screen = &wp->base;
screen_init(&wp->status_screen, 1, 1, 0); screen_init(&wp->status_screen, 1, 1, 0);
if (gethostname(host, sizeof host) == 0) if (gethostname(host, sizeof host) == 0)
screen_set_title(&wp->base, host); screen_set_title(&wp->base, host);
return (wp); return (wp);
} }
static void static void
window_pane_destroy(struct window_pane *wp) window_pane_destroy(struct window_pane *wp)
{ {
struct window_pane_resize *r;
struct window_pane_resize *r1;
window_pane_reset_mode_all(wp); window_pane_reset_mode_all(wp);
free(wp->searchstr); free(wp->searchstr);
if (wp->fd != -1) { if (wp->fd != -1) {
#ifdef HAVE_UTEMPTER #ifdef HAVE_UTEMPTER
utempter_remove_record(wp->fd); utempter_remove_record(wp->fd);
#endif #endif
bufferevent_free(wp->event); bufferevent_free(wp->event);
close(wp->fd); close(wp->fd);
} }
skipping to change at line 930 skipping to change at line 918
screen_free(&wp->base); screen_free(&wp->base);
if (wp->pipe_fd != -1) { if (wp->pipe_fd != -1) {
bufferevent_free(wp->pipe_event); bufferevent_free(wp->pipe_event);
close(wp->pipe_fd); close(wp->pipe_fd);
} }
if (event_initialized(&wp->resize_timer)) if (event_initialized(&wp->resize_timer))
event_del(&wp->resize_timer); event_del(&wp->resize_timer);
if (event_initialized(&wp->force_timer)) TAILQ_FOREACH_SAFE(r, &wp->resize_queue, entry, r1) {
event_del(&wp->force_timer); TAILQ_REMOVE(&wp->resize_queue, r, entry);
free(r);
}
RB_REMOVE(window_pane_tree, &all_window_panes, wp); RB_REMOVE(window_pane_tree, &all_window_panes, wp);
options_free(wp->options); options_free(wp->options);
free((void *)wp->cwd); free((void *)wp->cwd);
free(wp->shell); free(wp->shell);
cmd_free_argv(wp->argc, wp->argv); cmd_free_argv(wp->argc, wp->argv);
free(wp->palette); free(wp->palette);
free(wp); free(wp);
} }
skipping to change at line 1000 skipping to change at line 990
NULL, window_pane_error_callback, wp); NULL, window_pane_error_callback, wp);
wp->ictx = input_init(wp, wp->event); wp->ictx = input_init(wp, wp->event);
bufferevent_enable(wp->event, EV_READ|EV_WRITE); bufferevent_enable(wp->event, EV_READ|EV_WRITE);
} }
void void
window_pane_resize(struct window_pane *wp, u_int sx, u_int sy) window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
{ {
struct window_mode_entry *wme; struct window_mode_entry *wme;
struct window_pane_resize *r;
if (sx == wp->sx && sy == wp->sy) if (sx == wp->sx && sy == wp->sy)
return; return;
r = xmalloc (sizeof *r);
r->sx = sx;
r->sy = sy;
r->osx = wp->sx;
r->osy = wp->sy;
TAILQ_INSERT_TAIL (&wp->resize_queue, r, entry);
wp->sx = sx; wp->sx = sx;
wp->sy = sy; wp->sy = sy;
log_debug("%s: %%%u resize %ux%u", __func__, wp->id, sx, sy); log_debug("%s: %%%u resize %ux%u", __func__, wp->id, sx, sy);
screen_resize(&wp->base, sx, sy, wp->base.saved_grid == NULL); screen_resize(&wp->base, sx, sy, wp->base.saved_grid == NULL);
wme = TAILQ_FIRST(&wp->modes); wme = TAILQ_FIRST(&wp->modes);
if (wme != NULL && wme->mode->resize != NULL) if (wme != NULL && wme->mode->resize != NULL)
wme->mode->resize(wme, sx, sy); wme->mode->resize(wme, sx, sy);
/*
* If the pane has already been resized, set the force flag and make
* the application resize twice to force it to redraw.
*/
if (wp->flags & PANE_RESIZE)
wp->flags |= PANE_RESIZEFORCE;
wp->flags |= PANE_RESIZE;
} }
void void
window_pane_set_palette(struct window_pane *wp, u_int n, int colour) window_pane_set_palette(struct window_pane *wp, u_int n, int colour)
{ {
if (n > 0xff) if (n > 0xff)
return; return;
if (wp->palette == NULL) if (wp->palette == NULL)
wp->palette = xcalloc(0x100, sizeof *wp->palette); wp->palette = xcalloc(0x100, sizeof *wp->palette);
 End of changes. 14 change blocks. 
31 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)