diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-01 17:30:28 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-01 17:30:28 +0100 |
commit | 3f1fc9cde33aac1fedd3ed9110f0d3e31308e92a (patch) | |
tree | 789c65808ce8342d606b249e298294719ef39447 | |
parent | 8110c7a25f257b13f92f34559efedba204e6ea98 (diff) | |
download | rtmux-3f1fc9cde33aac1fedd3ed9110f0d3e31308e92a.tar.gz rtmux-3f1fc9cde33aac1fedd3ed9110f0d3e31308e92a.tar.bz2 rtmux-3f1fc9cde33aac1fedd3ed9110f0d3e31308e92a.zip |
Get the whole overlay screen not just the mode so cursor changes are included.
-rw-r--r-- | popup.c | 4 | ||||
-rw-r--r-- | server-client.c | 18 | ||||
-rw-r--r-- | tmux.h | 2 |
3 files changed, 10 insertions, 14 deletions
@@ -136,7 +136,7 @@ popup_write_screen(struct client *c, struct popup_data *pd) screen_write_stop(&ctx); } -static int +static struct screen * popup_mode_cb(struct client *c, u_int *cx, u_int *cy) { struct popup_data *pd = c->overlay_data; @@ -145,7 +145,7 @@ popup_mode_cb(struct client *c, u_int *cx, u_int *cy) return (0); *cx = pd->px + 1 + pd->s.cx; *cy = pd->py + 1 + pd->s.cy; - return (pd->s.mode); + return (&pd->s); } static int diff --git a/server-client.c b/server-client.c index 5f7ce6b8..23435b48 100644 --- a/server-client.c +++ b/server-client.c @@ -1542,7 +1542,7 @@ server_client_reset_state(struct client *c) struct window_pane *wp = w->active, *loop; struct screen *s; struct options *oo = c->session->options; - int mode, cursor, flags; + int mode = 0, cursor, flags; u_int cx = 0, cy = 0, ox, oy, sx, sy; if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) @@ -1553,18 +1553,14 @@ server_client_reset_state(struct client *c) tty->flags &= ~TTY_BLOCK; /* Get mode from overlay if any, else from screen. */ - if (c->overlay_draw != NULL) { - s = NULL; - if (c->overlay_mode == NULL) - mode = 0; - else - mode = c->overlay_mode(c, &cx, &cy); - } else { + if (c->overlay_draw != NULL && c->overlay_mode != NULL) + s = c->overlay_mode(c, &cx, &cy); + else s = wp->screen; + if (s != NULL) mode = s->mode; - if (c->prompt_string != NULL || c->message_string != NULL) - mode &= ~MODE_CURSOR; - } + if (c->prompt_string != NULL || c->message_string != NULL) + mode &= ~MODE_CURSOR; log_debug("%s: client %s mode %x", __func__, c->name, mode); /* Reset region and margin. */ @@ -1509,7 +1509,7 @@ RB_HEAD(client_files, client_file); typedef int (*prompt_input_cb)(struct client *, void *, const char *, int); typedef void (*prompt_free_cb)(void *); typedef int (*overlay_check_cb)(struct client *, u_int, u_int); -typedef int (*overlay_mode_cb)(struct client *, u_int *, u_int *); +typedef struct screen *(*overlay_mode_cb)(struct client *, u_int *, u_int *); typedef void (*overlay_draw_cb)(struct client *, struct screen_redraw_ctx *); typedef int (*overlay_key_cb)(struct client *, struct key_event *); typedef void (*overlay_free_cb)(struct client *); |