mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Get the whole overlay screen not just the mode so cursor changes are included.
This commit is contained in:
		
							
								
								
									
										4
									
								
								popup.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								popup.c
									
									
									
									
									
								
							@@ -136,7 +136,7 @@ popup_write_screen(struct client *c, struct popup_data *pd)
 | 
				
			|||||||
	screen_write_stop(&ctx);
 | 
						screen_write_stop(&ctx);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int
 | 
					static struct screen *
 | 
				
			||||||
popup_mode_cb(struct client *c, u_int *cx, u_int *cy)
 | 
					popup_mode_cb(struct client *c, u_int *cx, u_int *cy)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct popup_data	*pd = c->overlay_data;
 | 
						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);
 | 
							return (0);
 | 
				
			||||||
	*cx = pd->px + 1 + pd->s.cx;
 | 
						*cx = pd->px + 1 + pd->s.cx;
 | 
				
			||||||
	*cy = pd->py + 1 + pd->s.cy;
 | 
						*cy = pd->py + 1 + pd->s.cy;
 | 
				
			||||||
	return (pd->s.mode);
 | 
						return (&pd->s);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int
 | 
					static int
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1542,7 +1542,7 @@ server_client_reset_state(struct client *c)
 | 
				
			|||||||
	struct window_pane	*wp = w->active, *loop;
 | 
						struct window_pane	*wp = w->active, *loop;
 | 
				
			||||||
	struct screen		*s;
 | 
						struct screen		*s;
 | 
				
			||||||
	struct options		*oo = c->session->options;
 | 
						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;
 | 
						u_int			 cx = 0, cy = 0, ox, oy, sx, sy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
 | 
						if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
 | 
				
			||||||
@@ -1553,18 +1553,14 @@ 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) {
 | 
						if (c->overlay_draw != NULL && c->overlay_mode != NULL)
 | 
				
			||||||
		s = NULL;
 | 
							s = c->overlay_mode(c, &cx, &cy);
 | 
				
			||||||
		if (c->overlay_mode == NULL)
 | 
						else
 | 
				
			||||||
			mode = 0;
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			mode = c->overlay_mode(c, &cx, &cy);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		s = wp->screen;
 | 
							s = wp->screen;
 | 
				
			||||||
 | 
						if (s != NULL)
 | 
				
			||||||
		mode = s->mode;
 | 
							mode = s->mode;
 | 
				
			||||||
		if (c->prompt_string != NULL || c->message_string != NULL)
 | 
						if (c->prompt_string != NULL || c->message_string != NULL)
 | 
				
			||||||
			mode &= ~MODE_CURSOR;
 | 
							mode &= ~MODE_CURSOR;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	log_debug("%s: client %s mode %x", __func__, c->name, mode);
 | 
						log_debug("%s: client %s mode %x", __func__, c->name, mode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Reset region and margin. */
 | 
						/* Reset region and margin. */
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1509,7 +1509,7 @@ RB_HEAD(client_files, client_file);
 | 
				
			|||||||
typedef int (*prompt_input_cb)(struct client *, void *, const char *, int);
 | 
					typedef int (*prompt_input_cb)(struct client *, void *, const char *, int);
 | 
				
			||||||
typedef void (*prompt_free_cb)(void *);
 | 
					typedef void (*prompt_free_cb)(void *);
 | 
				
			||||||
typedef int (*overlay_check_cb)(struct client *, u_int, u_int);
 | 
					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 void (*overlay_draw_cb)(struct client *, struct screen_redraw_ctx *);
 | 
				
			||||||
typedef int (*overlay_key_cb)(struct client *, struct key_event *);
 | 
					typedef int (*overlay_key_cb)(struct client *, struct key_event *);
 | 
				
			||||||
typedef void (*overlay_free_cb)(struct client *);
 | 
					typedef void (*overlay_free_cb)(struct client *);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user