mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	factor keyboard/cursor cleanup into own functions
This commit is contained in:
		
							parent
							
								
									0f9374c701
								
							
						
					
					
						commit
						58f5e8d16a
					
				
					 4 changed files with 28 additions and 12 deletions
				
			
		| 
						 | 
					@ -456,8 +456,10 @@ void cursor_set(struct seat *seat, const char *cursor_name);
 | 
				
			||||||
void cursor_update_focus(struct server *server);
 | 
					void cursor_update_focus(struct server *server);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void cursor_init(struct seat *seat);
 | 
					void cursor_init(struct seat *seat);
 | 
				
			||||||
 | 
					void cursor_finish(struct seat *seat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void keyboard_init(struct seat *seat);
 | 
					void keyboard_init(struct seat *seat);
 | 
				
			||||||
 | 
					void keyboard_finish(struct seat *seat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void arrange_layers(struct output *output);
 | 
					void arrange_layers(struct output *output);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								src/cursor.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								src/cursor.c
									
										
									
									
									
								
							| 
						 | 
					@ -716,3 +716,17 @@ cursor_init(struct seat *seat)
 | 
				
			||||||
	wl_signal_add(&seat->seat->events.request_set_primary_selection,
 | 
						wl_signal_add(&seat->seat->events.request_set_primary_selection,
 | 
				
			||||||
		&seat->request_set_primary_selection);
 | 
							&seat->request_set_primary_selection);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void cursor_finish(struct seat *seat) {
 | 
				
			||||||
 | 
						wl_list_remove(&seat->cursor_motion.link);
 | 
				
			||||||
 | 
						wl_list_remove(&seat->cursor_motion_absolute.link);
 | 
				
			||||||
 | 
						wl_list_remove(&seat->cursor_button.link);
 | 
				
			||||||
 | 
						wl_list_remove(&seat->cursor_axis.link);
 | 
				
			||||||
 | 
						wl_list_remove(&seat->cursor_frame.link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						wl_list_remove(&seat->request_cursor.link);
 | 
				
			||||||
 | 
						wl_list_remove(&seat->request_set_selection.link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						wlr_xcursor_manager_destroy(seat->xcursor_manager);
 | 
				
			||||||
 | 
						wlr_cursor_destroy(seat->cursor);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -218,3 +218,13 @@ keyboard_init(struct seat *seat)
 | 
				
			||||||
	seat->keyboard_modifiers.notify = keyboard_modifiers_notify;
 | 
						seat->keyboard_modifiers.notify = keyboard_modifiers_notify;
 | 
				
			||||||
	wl_signal_add(&kb->events.modifiers, &seat->keyboard_modifiers);
 | 
						wl_signal_add(&kb->events.modifiers, &seat->keyboard_modifiers);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					keyboard_finish(struct seat *seat)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (seat->keyboard_group) {
 | 
				
			||||||
 | 
							wlr_keyboard_group_destroy(seat->keyboard_group);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						wl_list_remove(&seat->keyboard_key.link);
 | 
				
			||||||
 | 
						wl_list_remove(&seat->keyboard_modifiers.link);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								src/seat.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								src/seat.c
									
										
									
									
									
								
							| 
						 | 
					@ -243,19 +243,9 @@ void
 | 
				
			||||||
seat_finish(struct server *server)
 | 
					seat_finish(struct server *server)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct seat *seat = &server->seat;
 | 
						struct seat *seat = &server->seat;
 | 
				
			||||||
	wl_list_remove(&seat->cursor_motion.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->cursor_motion_absolute.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->cursor_button.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->cursor_axis.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->cursor_frame.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->request_cursor.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->request_set_selection.link);
 | 
					 | 
				
			||||||
	wl_list_remove(&seat->new_input.link);
 | 
						wl_list_remove(&seat->new_input.link);
 | 
				
			||||||
	if (seat->keyboard_group) {
 | 
						keyboard_finish(seat);
 | 
				
			||||||
		wlr_keyboard_group_destroy(seat->keyboard_group);
 | 
						cursor_finish(seat);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	wlr_xcursor_manager_destroy(seat->xcursor_manager);
 | 
					 | 
				
			||||||
	wlr_cursor_destroy(seat->cursor);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue