mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	seat: map touch to configured output name
The output name linked to the touch device has preference when set. This happens when the compositor runs in nested mode.
This commit is contained in:
		
							parent
							
								
									614ce35f31
								
							
						
					
					
						commit
						21cf3071e3
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		
							
								
								
									
										13
									
								
								src/seat.c
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								src/seat.c
									
										
									
									
									
								
							| 
						 | 
					@ -263,6 +263,15 @@ new_keyboard(struct seat *seat, struct wlr_input_device *device, bool virtual)
 | 
				
			||||||
	return (struct input *)keyboard;
 | 
						return (struct input *)keyboard;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void
 | 
				
			||||||
 | 
					map_touch_to_output(struct seat *seat, struct wlr_input_device *dev)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct wlr_touch *touch = wlr_touch_from_input_device(dev);
 | 
				
			||||||
 | 
						char *output_name = touch->output_name ? touch->output_name : rc.touch.output_name;
 | 
				
			||||||
 | 
						wlr_log(WLR_INFO, "map touch to output %s\n", output_name);
 | 
				
			||||||
 | 
						map_input_to_output(seat, dev, output_name);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct input *
 | 
					static struct input *
 | 
				
			||||||
new_touch(struct seat *seat, struct wlr_input_device *dev)
 | 
					new_touch(struct seat *seat, struct wlr_input_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -273,9 +282,7 @@ new_touch(struct seat *seat, struct wlr_input_device *dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* In support of running with WLR_WL_OUTPUTS set to >=2 */
 | 
						/* In support of running with WLR_WL_OUTPUTS set to >=2 */
 | 
				
			||||||
	if (dev->type == WLR_INPUT_DEVICE_TOUCH) {
 | 
						if (dev->type == WLR_INPUT_DEVICE_TOUCH) {
 | 
				
			||||||
		struct wlr_touch *touch = wlr_touch_from_input_device(dev);
 | 
							map_touch_to_output(seat, dev);
 | 
				
			||||||
		wlr_log(WLR_INFO, "map touch to output %s\n", touch->output_name);
 | 
					 | 
				
			||||||
		map_input_to_output(seat, dev, touch->output_name);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return input;
 | 
						return input;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue