From c006717910e5f30ca65645f701541dfa176c1392 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 18 Oct 2018 21:20:00 +1000 Subject: Minor refactor of input manager The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat). --- include/sway/input/seat.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/sway/input/seat.h') diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index e9f553f3..ef65810c 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -47,7 +47,6 @@ enum sway_seat_operation { struct sway_seat { struct wlr_seat *wlr_seat; struct sway_cursor *cursor; - struct sway_input_manager *input; bool has_focus; struct wl_list focus_stack; // list of containers in focus order @@ -89,8 +88,7 @@ struct sway_seat { struct wl_list link; // input_manager::seats }; -struct sway_seat *seat_create(struct sway_input_manager *input, - const char *seat_name); +struct sway_seat *seat_create(const char *seat_name); void seat_destroy(struct sway_seat *seat); -- cgit v1.2.3-54-g00ecf