mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
162d3cb1f4
@ -222,9 +222,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (!detached && !is_control) {
|
if (!detached && !is_control) {
|
||||||
sx = c->tty.sx;
|
sx = c->tty.sx;
|
||||||
sy = c->tty.sy;
|
sy = c->tty.sy;
|
||||||
if (!is_control &&
|
if (sy > 0 && options_get_number(global_s_options, "status"))
|
||||||
sy > 0 &&
|
|
||||||
options_get_number(global_s_options, "status"))
|
|
||||||
sy--;
|
sy--;
|
||||||
} else {
|
} else {
|
||||||
value = options_get_string(global_s_options, "default-size");
|
value = options_get_string(global_s_options, "default-size");
|
||||||
|
42
resize.c
42
resize.c
@ -61,6 +61,18 @@ resize_window(struct window *w, u_int sx, u_int sy)
|
|||||||
notify_window("window-layout-changed", w);
|
notify_window("window-layout-changed", w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ignore_client_size(struct client *c)
|
||||||
|
{
|
||||||
|
if (c->session == NULL)
|
||||||
|
return (1);
|
||||||
|
if (c->flags & CLIENT_NOSIZEFLAGS)
|
||||||
|
return (1);
|
||||||
|
if ((c->flags & CLIENT_CONTROL) && (~c->flags & CLIENT_SIZECHANGED))
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy,
|
default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy,
|
||||||
int type)
|
int type)
|
||||||
@ -77,9 +89,7 @@ default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy,
|
|||||||
if (type == WINDOW_SIZE_LARGEST) {
|
if (type == WINDOW_SIZE_LARGEST) {
|
||||||
*sx = *sy = 0;
|
*sx = *sy = 0;
|
||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if (c->session == NULL)
|
if (ignore_client_size(c))
|
||||||
continue;
|
|
||||||
if (c->flags & CLIENT_NOSIZEFLAGS)
|
|
||||||
continue;
|
continue;
|
||||||
if (w != NULL && !session_has(c->session, w))
|
if (w != NULL && !session_has(c->session, w))
|
||||||
continue;
|
continue;
|
||||||
@ -99,9 +109,7 @@ default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy,
|
|||||||
} else {
|
} else {
|
||||||
*sx = *sy = UINT_MAX;
|
*sx = *sy = UINT_MAX;
|
||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if (c->session == NULL)
|
if (ignore_client_size(c))
|
||||||
continue;
|
|
||||||
if (c->flags & CLIENT_NOSIZEFLAGS)
|
|
||||||
continue;
|
continue;
|
||||||
if (w != NULL && !session_has(c->session, w))
|
if (w != NULL && !session_has(c->session, w))
|
||||||
continue;
|
continue;
|
||||||
@ -146,7 +154,7 @@ recalculate_sizes(void)
|
|||||||
struct client *c;
|
struct client *c;
|
||||||
struct window *w;
|
struct window *w;
|
||||||
u_int sx, sy, cx, cy;
|
u_int sx, sy, cx, cy;
|
||||||
int flags, type, current, has, changed;
|
int type, current, has, changed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear attached count and update saved status line information for
|
* Clear attached count and update saved status line information for
|
||||||
@ -162,21 +170,13 @@ recalculate_sizes(void)
|
|||||||
* client.
|
* client.
|
||||||
*/
|
*/
|
||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if ((s = c->session) == NULL)
|
if (ignore_client_size(c))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
flags = c->flags;
|
|
||||||
if (flags & CLIENT_SUSPENDED)
|
|
||||||
continue;
|
|
||||||
if ((flags & CLIENT_CONTROL) && (~flags & CLIENT_SIZECHANGED))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (c->tty.sy <= status_line_size(c))
|
if (c->tty.sy <= status_line_size(c))
|
||||||
c->flags |= CLIENT_STATUSOFF;
|
c->flags |= CLIENT_STATUSOFF;
|
||||||
else
|
else
|
||||||
c->flags &= ~CLIENT_STATUSOFF;
|
c->flags &= ~CLIENT_STATUSOFF;
|
||||||
|
c->session->attached++;
|
||||||
s->attached++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Walk each window and adjust the size. */
|
/* Walk each window and adjust the size. */
|
||||||
@ -194,8 +194,10 @@ recalculate_sizes(void)
|
|||||||
if (type == WINDOW_SIZE_LARGEST) {
|
if (type == WINDOW_SIZE_LARGEST) {
|
||||||
sx = sy = 0;
|
sx = sy = 0;
|
||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if ((s = c->session) == NULL)
|
if (ignore_client_size(c))
|
||||||
continue;
|
continue;
|
||||||
|
s = c->session;
|
||||||
|
|
||||||
if (current)
|
if (current)
|
||||||
has = (s->curw->window == w);
|
has = (s->curw->window == w);
|
||||||
else
|
else
|
||||||
@ -216,8 +218,10 @@ recalculate_sizes(void)
|
|||||||
} else {
|
} else {
|
||||||
sx = sy = UINT_MAX;
|
sx = sy = UINT_MAX;
|
||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if ((s = c->session) == NULL)
|
if (ignore_client_size(c))
|
||||||
continue;
|
continue;
|
||||||
|
s = c->session;
|
||||||
|
|
||||||
if (current)
|
if (current)
|
||||||
has = (s->curw->window == w);
|
has = (s->curw->window == w);
|
||||||
else
|
else
|
||||||
|
3
tmux.h
3
tmux.h
@ -1395,8 +1395,7 @@ struct client {
|
|||||||
CLIENT_REDRAWSTATUSALWAYS| \
|
CLIENT_REDRAWSTATUSALWAYS| \
|
||||||
CLIENT_REDRAWBORDERS)
|
CLIENT_REDRAWBORDERS)
|
||||||
#define CLIENT_NOSIZEFLAGS \
|
#define CLIENT_NOSIZEFLAGS \
|
||||||
(CLIENT_EXIT| \
|
(CLIENT_DEAD| \
|
||||||
CLIENT_DEAD| \
|
|
||||||
CLIENT_SUSPENDED| \
|
CLIENT_SUSPENDED| \
|
||||||
CLIENT_DETACHING)
|
CLIENT_DETACHING)
|
||||||
int flags;
|
int flags;
|
||||||
|
4
window.c
4
window.c
@ -501,8 +501,8 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
|||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
|
|
||||||
TAILQ_FOREACH(wp, &w->panes, entry) {
|
TAILQ_FOREACH(wp, &w->panes, entry) {
|
||||||
if (!window_pane_visible(wp))
|
if (!window_pane_visible(wp))
|
||||||
continue;
|
continue;
|
||||||
if (x < wp->xoff || x > wp->xoff + wp->sx)
|
if (x < wp->xoff || x > wp->xoff + wp->sx)
|
||||||
continue;
|
continue;
|
||||||
if (y < wp->yoff || y > wp->yoff + wp->sy)
|
if (y < wp->yoff || y > wp->yoff + wp->sy)
|
||||||
|
Loading…
Reference in New Issue
Block a user