aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-08 21:02:25 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-08 21:02:25 +0100
commit4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31 (patch)
treee7b208da1146e64e5f91d978375478d0f3fb792b
parentb24d7d9c95c2083f14715f95a5a96fcb5204eca0 (diff)
parentf9682d2e558c58117f23f302ce35d9b319151189 (diff)
downloadrtmux-4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31.tar.gz
rtmux-4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31.tar.bz2
rtmux-4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31.zip
Merge branch 'obsd-master'
-rw-r--r--cmd-display-panes.c1
-rw-r--r--cmd-find.c8
-rw-r--r--cmd.c17
-rw-r--r--screen-redraw.c2
-rw-r--r--server-client.c11
-rw-r--r--tmux.h4
6 files changed, 30 insertions, 13 deletions
diff --git a/cmd-display-panes.c b/cmd-display-panes.c
index 45f59a6b..8940b429 100644
--- a/cmd-display-panes.c
+++ b/cmd-display-panes.c
@@ -18,7 +18,6 @@
#include <sys/types.h>
-#include <ctype.h>
#include <stdlib.h>
#include <string.h>
diff --git a/cmd-find.c b/cmd-find.c
index 2009a0b3..7ad8ad7a 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -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;
diff --git a/cmd.c b/cmd.c
index 1d52da65..3e35ef3c 100644
--- a/cmd.c
+++ b/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. */
diff --git a/screen-redraw.c b/screen-redraw.c
index 5278e776..dbae11b7 100644
--- a/screen-redraw.c
+++ b/screen-redraw.c
@@ -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);
}
diff --git a/server-client.c b/server-client.c
index 82a1a290..fdc40d8d 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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);
diff --git a/tmux.h b/tmux.h
index f31d0a1f..ec9d1748 100644
--- a/tmux.h
+++ b/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| \