mirror of
https://github.com/tmux/tmux.git
synced 2025-09-04 06:56:58 +00:00
menu_mode_cb needs to return a screen also.
This commit is contained in:
8
menu.c
8
menu.c
@ -130,14 +130,12 @@ menu_free(struct menu *menu)
|
|||||||
free(menu);
|
free(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static struct screen *
|
||||||
menu_mode_cb(struct client *c, __unused u_int *cx, __unused u_int *cy)
|
menu_mode_cb(struct client *c, __unused u_int *cx, __unused u_int *cy)
|
||||||
{
|
{
|
||||||
struct menu_data *md = c->overlay_data;
|
struct menu_data *md = c->overlay_data;
|
||||||
|
|
||||||
if (~md->flags & MENU_NOMOUSE)
|
return (&md->s);
|
||||||
return (MODE_MOUSE_ALL);
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -351,6 +349,8 @@ menu_display(struct menu *menu, int flags, struct cmdq_item *item, u_int px,
|
|||||||
if (fs != NULL)
|
if (fs != NULL)
|
||||||
cmd_find_copy_state(&md->fs, fs);
|
cmd_find_copy_state(&md->fs, fs);
|
||||||
screen_init(&md->s, menu->width + 4, menu->count + 2, 0);
|
screen_init(&md->s, menu->width + 4, menu->count + 2, 0);
|
||||||
|
if (~md->flags & MENU_NOMOUSE)
|
||||||
|
md->s.mode |= MODE_MOUSE_ALL;
|
||||||
|
|
||||||
md->px = px;
|
md->px = px;
|
||||||
md->py = py;
|
md->py = py;
|
||||||
|
@ -1540,7 +1540,7 @@ server_client_reset_state(struct client *c)
|
|||||||
struct tty *tty = &c->tty;
|
struct tty *tty = &c->tty;
|
||||||
struct window *w = c->session->curw->window;
|
struct window *w = c->session->curw->window;
|
||||||
struct window_pane *wp = w->active, *loop;
|
struct window_pane *wp = w->active, *loop;
|
||||||
struct screen *s;
|
struct screen *s = NULL;
|
||||||
struct options *oo = c->session->options;
|
struct options *oo = c->session->options;
|
||||||
int mode = 0, cursor, flags;
|
int mode = 0, cursor, flags;
|
||||||
u_int cx = 0, cy = 0, ox, oy, sx, sy;
|
u_int cx = 0, cy = 0, ox, oy, sx, sy;
|
||||||
@ -1553,9 +1553,10 @@ server_client_reset_state(struct client *c)
|
|||||||
tty->flags &= ~TTY_BLOCK;
|
tty->flags &= ~TTY_BLOCK;
|
||||||
|
|
||||||
/* Get mode from overlay if any, else from screen. */
|
/* Get mode from overlay if any, else from screen. */
|
||||||
if (c->overlay_draw != NULL && c->overlay_mode != NULL)
|
if (c->overlay_draw != NULL) {
|
||||||
s = c->overlay_mode(c, &cx, &cy);
|
if (c->overlay_mode != NULL)
|
||||||
else
|
s = c->overlay_mode(c, &cx, &cy);
|
||||||
|
} else
|
||||||
s = wp->screen;
|
s = wp->screen;
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
mode = s->mode;
|
mode = s->mode;
|
||||||
|
Reference in New Issue
Block a user