mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	keyboard: Fix cycle view taking precedence over TTY switch
I had a bug where cycle view would not close and I was unable to switch to a TTY as it was open. Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
		
							parent
							
								
									23b5eb294e
								
							
						
					
					
						commit
						98085b4546
					
				
					 1 changed files with 12 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -104,6 +104,18 @@ handle_compositor_keybindings(struct wl_listener *listener,
 | 
			
		|||
	uint32_t modifiers =
 | 
			
		||||
		wlr_keyboard_get_modifiers(device->keyboard);
 | 
			
		||||
 | 
			
		||||
	/* Catch C-A-F1 to C-A-F12 to change tty */
 | 
			
		||||
	if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
 | 
			
		||||
		for (int i = 0; i < nsyms; i++) {
 | 
			
		||||
			unsigned int vt = syms[i] - XKB_KEY_XF86Switch_VT_1 + 1;
 | 
			
		||||
			if (vt >= 1 && vt <= 12) {
 | 
			
		||||
				change_vt(server, vt);
 | 
			
		||||
				/* don't send any key events to clients when changing tty */
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (server->cycle_view) {
 | 
			
		||||
		damage_all_outputs(server);
 | 
			
		||||
		if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
 | 
			
		||||
| 
						 | 
				
			
			@ -133,17 +145,6 @@ handle_compositor_keybindings(struct wl_listener *listener,
 | 
			
		|||
			handled |= handle_keybinding(server, modifiers, syms[i]);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Catch C-A-F1 to C-A-F12 to change tty */
 | 
			
		||||
	if (!handled && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
 | 
			
		||||
		for (int i = 0; i < nsyms; i++) {
 | 
			
		||||
			unsigned int vt = syms[i] - XKB_KEY_XF86Switch_VT_1 + 1;
 | 
			
		||||
			if (vt >= 1 && vt <= 12) {
 | 
			
		||||
				change_vt(server, vt);
 | 
			
		||||
				handled = true;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return handled;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue