mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Check input_mode to see whether window switcher is active or not
...rather than "if (server->osd_state.cycle_view){..}".
			
			
This commit is contained in:
		
							parent
							
								
									398b80b26f
								
							
						
					
					
						commit
						5d3ce3e190
					
				
					 6 changed files with 17 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -614,7 +614,8 @@ cursor_process_motion(struct server *server, uint32_t time, double *sx, double *
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
 | 
			
		||||
			&& !server->osd_state.cycle_view) {
 | 
			
		||||
			&& server->input_mode
 | 
			
		||||
				!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
			
		||||
		desktop_focus_view_or_surface(seat, ctx.view, ctx.surface,
 | 
			
		||||
			rc.raise_on_focus);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -655,7 +656,8 @@ _cursor_update_focus(struct server *server)
 | 
			
		|||
 | 
			
		||||
	if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
 | 
			
		||||
			&& !rc.focus_follow_mouse_requires_movement
 | 
			
		||||
			&& !server->osd_state.cycle_view) {
 | 
			
		||||
			&& server->input_mode
 | 
			
		||||
				!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
			
		||||
		/* Prevents changing keyboard focus during A-Tab */
 | 
			
		||||
		desktop_focus_view_or_surface(&server->seat, ctx.view,
 | 
			
		||||
			ctx.surface, rc.raise_on_focus);
 | 
			
		||||
| 
						 | 
				
			
			@ -901,7 +903,7 @@ static void
 | 
			
		|||
handle_release_mousebinding(struct server *server,
 | 
			
		||||
		struct cursor_context *ctx, uint32_t button)
 | 
			
		||||
{
 | 
			
		||||
	if (server->osd_state.cycle_view) {
 | 
			
		||||
	if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -968,7 +970,7 @@ static bool
 | 
			
		|||
handle_press_mousebinding(struct server *server, struct cursor_context *ctx,
 | 
			
		||||
		uint32_t button)
 | 
			
		||||
{
 | 
			
		||||
	if (server->osd_state.cycle_view) {
 | 
			
		||||
	if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -133,10 +133,12 @@ keyboard_modifiers_notify(struct wl_listener *listener, void *data)
 | 
			
		|||
		overlay_update(seat);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (server->osd_state.cycle_view
 | 
			
		||||
			|| seat->workspace_osd_shown_by_modifier) {
 | 
			
		||||
	bool window_switcher_active = server->input_mode
 | 
			
		||||
					== LAB_INPUT_STATE_WINDOW_SWITCHER;
 | 
			
		||||
 | 
			
		||||
	if (window_switcher_active || seat->workspace_osd_shown_by_modifier) {
 | 
			
		||||
		if (!keyboard_any_modifiers_pressed(wlr_keyboard)) {
 | 
			
		||||
			if (server->osd_state.cycle_view) {
 | 
			
		||||
			if (window_switcher_active) {
 | 
			
		||||
				if (key_state_nr_bound_keys()) {
 | 
			
		||||
					should_cancel_cycling_on_next_key_release = true;
 | 
			
		||||
				} else {
 | 
			
		||||
| 
						 | 
				
			
			@ -570,9 +572,7 @@ handle_compositor_keybindings(struct keyboard *keyboard,
 | 
			
		|||
			key_state_store_pressed_key_as_bound(event->keycode);
 | 
			
		||||
			handle_menu_keys(server, &keyinfo.translated);
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (server->osd_state.cycle_view) {
 | 
			
		||||
		} else if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
			
		||||
			key_state_store_pressed_key_as_bound(event->keycode);
 | 
			
		||||
			handle_cycle_view_key(server, &keyinfo);
 | 
			
		||||
			return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue