diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-18 21:20:00 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-20 13:11:43 +1000 |
commit | c006717910e5f30ca65645f701541dfa176c1392 (patch) | |
tree | c64452b7f2fe6ab481ad90c424cb14bcb0328eda /sway/desktop/transaction.c | |
parent | Merge pull request #2872 from RyanDwyer/cursor-rebase (diff) | |
download | sway-c006717910e5f30ca65645f701541dfa176c1392.tar.gz sway-c006717910e5f30ca65645f701541dfa176c1392.tar.zst sway-c006717910e5f30ca65645f701541dfa176c1392.zip |
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).
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r-- | sway/desktop/transaction.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index e717ee35..5dec279d 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -110,7 +110,7 @@ static void copy_workspace_state(struct sway_workspace *ws, | |||
110 | list_cat(state->floating, ws->floating); | 110 | list_cat(state->floating, ws->floating); |
111 | list_cat(state->tiling, ws->tiling); | 111 | list_cat(state->tiling, ws->tiling); |
112 | 112 | ||
113 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 113 | struct sway_seat *seat = input_manager_current_seat(); |
114 | state->focused = seat_get_focus(seat) == &ws->node; | 114 | state->focused = seat_get_focus(seat) == &ws->node; |
115 | 115 | ||
116 | // Set focused_inactive_child to the direct tiling child | 116 | // Set focused_inactive_child to the direct tiling child |
@@ -153,7 +153,7 @@ static void copy_container_state(struct sway_container *container, | |||
153 | list_cat(state->children, container->children); | 153 | list_cat(state->children, container->children); |
154 | } | 154 | } |
155 | 155 | ||
156 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 156 | struct sway_seat *seat = input_manager_current_seat(); |
157 | state->focused = seat_get_focus(seat) == &container->node; | 157 | state->focused = seat_get_focus(seat) == &container->node; |
158 | 158 | ||
159 | if (!container->view) { | 159 | if (!container->view) { |