mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	sway/input/keyboard: always set active keyboard if there is none
Previously, we incorrectly only set active keyboard for non-virtual devices.4c3c060211incorrectly put unrelated code in `sway_keyboard_set_layout`. Fixes:4c3c060211(cherry picked from commitc5ba7f23a5)
This commit is contained in:
		
							parent
							
								
									559f9eba33
								
							
						
					
					
						commit
						24fafa9490
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		| 
						 | 
					@ -1028,13 +1028,6 @@ static void sway_keyboard_set_layout(struct sway_keyboard *keyboard,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// If the seat has no active keyboard, set this one
 | 
					 | 
				
			||||||
	struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat;
 | 
					 | 
				
			||||||
	struct wlr_keyboard *current_keyboard = seat->keyboard_state.keyboard;
 | 
					 | 
				
			||||||
	if (current_keyboard == NULL) {
 | 
					 | 
				
			||||||
		wlr_seat_set_keyboard(seat, keyboard->wlr);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (keymap_changed) {
 | 
						if (keymap_changed) {
 | 
				
			||||||
		ipc_event_input("xkb_keymap",
 | 
							ipc_event_input("xkb_keymap",
 | 
				
			||||||
				  keyboard->seat_device->input_device);
 | 
									  keyboard->seat_device->input_device);
 | 
				
			||||||
| 
						 | 
					@ -1078,6 +1071,13 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
 | 
				
			||||||
		sway_keyboard_set_layout(keyboard, input_config);
 | 
							sway_keyboard_set_layout(keyboard, input_config);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// If the seat has no active keyboard, set this one
 | 
				
			||||||
 | 
						struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat;
 | 
				
			||||||
 | 
						struct wlr_keyboard *current_keyboard = seat->keyboard_state.keyboard;
 | 
				
			||||||
 | 
						if (current_keyboard == NULL) {
 | 
				
			||||||
 | 
							wlr_seat_set_keyboard(seat, keyboard->wlr);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_list_remove(&keyboard->keyboard_key.link);
 | 
						wl_list_remove(&keyboard->keyboard_key.link);
 | 
				
			||||||
	wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key);
 | 
						wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key);
 | 
				
			||||||
	keyboard->keyboard_key.notify = handle_keyboard_key;
 | 
						keyboard->keyboard_key.notify = handle_keyboard_key;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue