mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Implement "all event" (1003) mouse mode but in a way that works. The
main issue is that if we have two panes, A with 1002 and B with 1003, we need to set 1003 outside tmux in order to get all the mouse events, but then we need to suppress the ones that pane A doesn't want. This is easy in SGR mouse mode, because buttons == 3 is only used for movement events (for other events the trailing m/M marks a release instead), but in normal mouse mode we can't tell so easily. So for that, look at the previous event instead - if it is drag+release as well, then the current event is a movement event.
This commit is contained in:
		
							
								
								
									
										5
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								input.c
									
									
									
									
									
								
							@@ -1477,6 +1477,7 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx)
 | 
			
		||||
		case 1000:
 | 
			
		||||
		case 1001:
 | 
			
		||||
		case 1002:
 | 
			
		||||
		case 1003:
 | 
			
		||||
			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES);
 | 
			
		||||
			break;
 | 
			
		||||
		case 1004:
 | 
			
		||||
@@ -1560,6 +1561,10 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx)
 | 
			
		||||
			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES);
 | 
			
		||||
			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_BUTTON);
 | 
			
		||||
			break;
 | 
			
		||||
		case 1003:
 | 
			
		||||
			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES);
 | 
			
		||||
			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_ALL);
 | 
			
		||||
			break;
 | 
			
		||||
		case 1004:
 | 
			
		||||
			if (ictx->ctx.s->mode & MODE_FOCUSON)
 | 
			
		||||
				break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user