mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
4bc45fc95a
@ -18,7 +18,6 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -1039,12 +1039,16 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
||||
switch (type) {
|
||||
case CMD_FIND_PANE:
|
||||
fs->wp = cmd_mouse_pane(m, &fs->s, &fs->wl);
|
||||
if (fs->wp != NULL)
|
||||
if (fs->wp != NULL) {
|
||||
fs->w = fs->wl->window;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case CMD_FIND_WINDOW:
|
||||
case CMD_FIND_SESSION:
|
||||
fs->wl = cmd_mouse_window(m, &fs->s);
|
||||
if (fs->wl == NULL && fs->s != NULL)
|
||||
fs->wl = fs->s->curw;
|
||||
if (fs->wl != NULL) {
|
||||
fs->w = fs->wl->window;
|
||||
fs->wp = fs->w->active;
|
||||
|
17
cmd.c
17
cmd.c
@ -509,17 +509,22 @@ cmd_mouse_window(struct mouse_event *m, struct session **sp)
|
||||
{
|
||||
struct session *s;
|
||||
struct window *w;
|
||||
struct winlink *wl;
|
||||
|
||||
if (!m->valid || m->s == -1 || m->w == -1)
|
||||
if (!m->valid)
|
||||
return (NULL);
|
||||
if ((s = session_find_by_id(m->s)) == NULL)
|
||||
if (m->s == -1 || (s = session_find_by_id(m->s)) == NULL)
|
||||
return (NULL);
|
||||
if ((w = window_find_by_id(m->w)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (m->w == -1)
|
||||
wl = s->curw;
|
||||
else {
|
||||
if ((w = window_find_by_id(m->w)) == NULL)
|
||||
return (NULL);
|
||||
wl = winlink_find_by_window(&s->windows, w);
|
||||
}
|
||||
if (sp != NULL)
|
||||
*sp = s;
|
||||
return (winlink_find_by_window(&s->windows, w));
|
||||
return (wl);
|
||||
}
|
||||
|
||||
/* Get current mouse pane if any. */
|
||||
|
@ -447,7 +447,7 @@ screen_redraw_screen(struct client *c)
|
||||
if (ctx.statuslines != 0 &&
|
||||
(flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS)))
|
||||
screen_redraw_draw_status(&ctx);
|
||||
if (c->overlay_draw != NULL)
|
||||
if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY))
|
||||
c->overlay_draw(c, &ctx);
|
||||
tty_reset(&c->tty);
|
||||
}
|
||||
|
@ -77,6 +77,9 @@ server_client_set_overlay(struct client *c, u_int delay, overlay_draw_cb drawcb,
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (c->overlay_draw != NULL)
|
||||
server_client_clear_overlay(c);
|
||||
|
||||
tv.tv_sec = delay / 1000;
|
||||
tv.tv_usec = (delay % 1000) * 1000L;
|
||||
|
||||
@ -1443,6 +1446,8 @@ server_client_reset_state(struct client *c)
|
||||
|
||||
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
|
||||
return;
|
||||
if (c->overlay_draw != NULL)
|
||||
return;
|
||||
mode = s->mode;
|
||||
|
||||
tty_region_off(&c->tty);
|
||||
@ -1553,10 +1558,11 @@ server_client_check_redraw(struct client *c)
|
||||
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
|
||||
return;
|
||||
if (c->flags & CLIENT_ALLREDRAWFLAGS) {
|
||||
log_debug("%s: redraw%s%s%s", c->name,
|
||||
log_debug("%s: redraw%s%s%s%s", c->name,
|
||||
(c->flags & CLIENT_REDRAWWINDOW) ? " window" : "",
|
||||
(c->flags & CLIENT_REDRAWSTATUS) ? " status" : "",
|
||||
(c->flags & CLIENT_REDRAWBORDERS) ? " borders" : "");
|
||||
(c->flags & CLIENT_REDRAWBORDERS) ? " borders" : "",
|
||||
(c->flags & CLIENT_REDRAWOVERLAY) ? " overlay" : "");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1712,6 +1718,7 @@ server_client_dispatch(struct imsg *imsg, void *arg)
|
||||
|
||||
if (c->flags & CLIENT_CONTROL)
|
||||
break;
|
||||
server_client_clear_overlay(c);
|
||||
tty_resize(&c->tty);
|
||||
recalculate_sizes();
|
||||
server_redraw_client(c);
|
||||
|
4
tmux.h
4
tmux.h
@ -1460,11 +1460,13 @@ struct client {
|
||||
#define CLIENT_SIZECHANGED 0x400000
|
||||
#define CLIENT_STATUSOFF 0x800000
|
||||
#define CLIENT_REDRAWSTATUSALWAYS 0x1000000
|
||||
#define CLIENT_REDRAWOVERLAY 0x2000000
|
||||
#define CLIENT_ALLREDRAWFLAGS \
|
||||
(CLIENT_REDRAWWINDOW| \
|
||||
CLIENT_REDRAWSTATUS| \
|
||||
CLIENT_REDRAWSTATUSALWAYS| \
|
||||
CLIENT_REDRAWBORDERS)
|
||||
CLIENT_REDRAWBORDERS| \
|
||||
CLIENT_REDRAWOVERLAY)
|
||||
#define CLIENT_NOSIZEFLAGS \
|
||||
(CLIENT_DEAD| \
|
||||
CLIENT_SUSPENDED| \
|
||||
|
Loading…
Reference in New Issue
Block a user