mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	src: avoid implicit int/bool -> enum conversions
Use the defined enum constants instead.
This commit is contained in:
		
							parent
							
								
									cd8a8c2bf6
								
							
						
					
					
						commit
						8b7ae52a91
					
				
					 2 changed files with 10 additions and 10 deletions
				
			
		| 
						 | 
					@ -1556,7 +1556,7 @@ rcxml_init(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rc.gap = 0;
 | 
						rc.gap = 0;
 | 
				
			||||||
	rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED;
 | 
						rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED;
 | 
				
			||||||
	rc.allow_tearing = false;
 | 
						rc.allow_tearing = LAB_TEARING_DISABLED;
 | 
				
			||||||
	rc.auto_enable_outputs = true;
 | 
						rc.auto_enable_outputs = true;
 | 
				
			||||||
	rc.reuse_output_mode = false;
 | 
						rc.reuse_output_mode = false;
 | 
				
			||||||
	rc.xwayland_persistence = false;
 | 
						rc.xwayland_persistence = false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -387,7 +387,7 @@ get_keyinfo(struct wlr_keyboard *wlr_keyboard, uint32_t evdev_keycode)
 | 
				
			||||||
	return keyinfo;
 | 
						return keyinfo;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static bool
 | 
					static enum lab_key_handled
 | 
				
			||||||
handle_key_release(struct server *server, uint32_t evdev_keycode)
 | 
					handle_key_release(struct server *server, uint32_t evdev_keycode)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
| 
						 | 
					@ -395,7 +395,7 @@ handle_key_release(struct server *server, uint32_t evdev_keycode)
 | 
				
			||||||
	 * forwarded to clients to avoid stuck keys.
 | 
						 * forwarded to clients to avoid stuck keys.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (!key_state_corresponding_press_event_was_bound(evdev_keycode)) {
 | 
						if (!key_state_corresponding_press_event_was_bound(evdev_keycode)) {
 | 
				
			||||||
		return false;
 | 
							return LAB_KEY_HANDLED_FALSE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
| 
						 | 
					@ -416,7 +416,7 @@ handle_key_release(struct server *server, uint32_t evdev_keycode)
 | 
				
			||||||
	 * not forward the corresponding release event to clients.
 | 
						 * not forward the corresponding release event to clients.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	key_state_bound_key_remove(evdev_keycode);
 | 
						key_state_bound_key_remove(evdev_keycode);
 | 
				
			||||||
	return true;
 | 
						return LAB_KEY_HANDLED_TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static bool
 | 
					static bool
 | 
				
			||||||
| 
						 | 
					@ -518,10 +518,10 @@ handle_compositor_keybindings(struct keyboard *keyboard,
 | 
				
			||||||
			key_state_bound_key_remove(event->keycode);
 | 
								key_state_bound_key_remove(event->keycode);
 | 
				
			||||||
			if (locked && !cur_keybind->allow_when_locked) {
 | 
								if (locked && !cur_keybind->allow_when_locked) {
 | 
				
			||||||
				cur_keybind = NULL;
 | 
									cur_keybind = NULL;
 | 
				
			||||||
				return true;
 | 
									return LAB_KEY_HANDLED_TRUE;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			actions_run(NULL, server, &cur_keybind->actions, NULL);
 | 
								actions_run(NULL, server, &cur_keybind->actions, NULL);
 | 
				
			||||||
			return true;
 | 
								return LAB_KEY_HANDLED_TRUE;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			return handle_key_release(server, event->keycode);
 | 
								return handle_key_release(server, event->keycode);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -542,11 +542,11 @@ handle_compositor_keybindings(struct keyboard *keyboard,
 | 
				
			||||||
		if (server->input_mode == LAB_INPUT_STATE_MENU) {
 | 
							if (server->input_mode == LAB_INPUT_STATE_MENU) {
 | 
				
			||||||
			key_state_store_pressed_key_as_bound(event->keycode);
 | 
								key_state_store_pressed_key_as_bound(event->keycode);
 | 
				
			||||||
			handle_menu_keys(server, &keyinfo.translated);
 | 
								handle_menu_keys(server, &keyinfo.translated);
 | 
				
			||||||
			return true;
 | 
								return LAB_KEY_HANDLED_TRUE;
 | 
				
			||||||
		} else if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
							} else if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
 | 
				
			||||||
			if (handle_cycle_view_key(server, &keyinfo)) {
 | 
								if (handle_cycle_view_key(server, &keyinfo)) {
 | 
				
			||||||
				key_state_store_pressed_key_as_bound(event->keycode);
 | 
									key_state_store_pressed_key_as_bound(event->keycode);
 | 
				
			||||||
				return true;
 | 
									return LAB_KEY_HANDLED_TRUE;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -565,10 +565,10 @@ handle_compositor_keybindings(struct keyboard *keyboard,
 | 
				
			||||||
		if (!cur_keybind->on_release) {
 | 
							if (!cur_keybind->on_release) {
 | 
				
			||||||
			actions_run(NULL, server, &cur_keybind->actions, NULL);
 | 
								actions_run(NULL, server, &cur_keybind->actions, NULL);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return true;
 | 
							return LAB_KEY_HANDLED_TRUE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return false;
 | 
						return LAB_KEY_HANDLED_FALSE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int
 | 
					static int
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue