mirror of
				https://github.com/DreamMaoMao/maomaowm.git
				synced 2025-11-03 09:01:47 -05:00 
			
		
		
		
	fix: set wrong keyboard_grab in handle_input_method_grab_keyboard
This results in the inability to continuously use the mod key and mouse to drag the window the problem also in axisbind and gesturebind
This commit is contained in:
		
							parent
							
								
									b896491e71
								
							
						
					
					
						commit
						76322947e1
					
				
					 2 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -111,6 +111,8 @@ get_keyboard_grab(KeyboardGroup *keyboard) {
 | 
			
		|||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 如果键盘不是物理键盘组的键盘,则返回NULL
 | 
			
		||||
	// kb_group是一个物理键盘组,它的键盘是物理键盘
 | 
			
		||||
	if (keyboard != kb_group)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -347,7 +349,9 @@ static void handle_input_method_grab_keyboard(struct wl_listener *listener,
 | 
			
		|||
		wl_container_of(listener, relay, input_method_grab_keyboard);
 | 
			
		||||
	struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = data;
 | 
			
		||||
 | 
			
		||||
	struct wlr_keyboard *active_keyboard = wlr_seat_get_keyboard(seat);
 | 
			
		||||
	// 活动键盘应该是从物理键盘组中获取的,
 | 
			
		||||
	// wlr_seat_get_keyboard可能获取到的是虚拟键盘,所以会造成设置错误
 | 
			
		||||
	struct wlr_keyboard *active_keyboard = &kb_group->wlr_group->keyboard;
 | 
			
		||||
 | 
			
		||||
	if (!is_keyboard_emulated_by_input_method(active_keyboard,
 | 
			
		||||
											  relay->input_method)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1554,7 +1554,7 @@ axisnotify(struct wl_listener *listener, void *data) {
 | 
			
		|||
	// IDLE_NOTIFY_ACTIVITY;
 | 
			
		||||
	handlecursoractivity();
 | 
			
		||||
	wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
 | 
			
		||||
	keyboard = wlr_seat_get_keyboard(seat);
 | 
			
		||||
	keyboard = &kb_group->wlr_group->keyboard;
 | 
			
		||||
 | 
			
		||||
	// 获取当前按键的mask,比如alt+super或者alt+ctrl
 | 
			
		||||
	mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1619,7 +1619,7 @@ int ongesture(struct wlr_pointer_swipe_end_event *event) {
 | 
			
		|||
		motion = swipe_dy < 0 ? SWIPE_UP : SWIPE_DOWN;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	keyboard = wlr_seat_get_keyboard(seat);
 | 
			
		||||
	keyboard = &kb_group->wlr_group->keyboard;
 | 
			
		||||
	mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
 | 
			
		||||
 | 
			
		||||
	for (ji = 0; ji < config.gesture_bindings_count; ji++) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1782,7 +1782,7 @@ buttonpress(struct wl_listener *listener, void *data) {
 | 
			
		|||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		keyboard = wlr_seat_get_keyboard(seat);
 | 
			
		||||
		keyboard = &kb_group->wlr_group->keyboard;
 | 
			
		||||
		mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
 | 
			
		||||
		for (ji = 0; ji < config.mouse_bindings_count; ji++) {
 | 
			
		||||
			if (config.mouse_bindings_count < 1)
 | 
			
		||||
| 
						 | 
				
			
			@ -3109,6 +3109,7 @@ void keypressmod(struct wl_listener *listener, void *data) {
 | 
			
		|||
	KeyboardGroup *group = wl_container_of(listener, group, modifiers);
 | 
			
		||||
 | 
			
		||||
	if (!dwl_im_keyboard_grab_forward_modifiers(group)) {
 | 
			
		||||
 | 
			
		||||
		wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
 | 
			
		||||
		/* Send modifiers to the client. */
 | 
			
		||||
		wlr_seat_keyboard_notify_modifiers(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue