diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-29 16:17:55 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-03-29 16:40:40 -0400 |
commit | b90099b4b7df8068446c658ab99b58ff83648954 (patch) | |
tree | a822ef3605ce98f9d8633c24f6927bb11effbdcc /sway/input | |
parent | remove swayc_t typedef (diff) | |
download | sway-b90099b4b7df8068446c658ab99b58ff83648954.tar.gz sway-b90099b4b7df8068446c658ab99b58ff83648954.tar.zst sway-b90099b4b7df8068446c658ab99b58ff83648954.zip |
rename container functions
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/cursor.c | 8 | ||||
-rw-r--r-- | sway/input/seat.c | 34 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index c0e14265..a0e4b9be 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -49,8 +49,8 @@ static void cursor_send_pointer_motion(struct sway_cursor *cursor, | |||
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | swayc_t *swayc = | 52 | struct sway_container *swayc = |
53 | swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); | 53 | sway_container_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); |
54 | if (swayc) { | 54 | if (swayc) { |
55 | wlr_seat_pointer_notify_enter(seat, surface, sx, sy); | 55 | wlr_seat_pointer_notify_enter(seat, surface, sx, sy); |
56 | wlr_seat_pointer_notify_motion(seat, time, sx, sy); | 56 | wlr_seat_pointer_notify_motion(seat, time, sx, sy); |
@@ -87,8 +87,8 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) { | |||
87 | if (event->button == BTN_LEFT) { | 87 | if (event->button == BTN_LEFT) { |
88 | struct wlr_surface *surface = NULL; | 88 | struct wlr_surface *surface = NULL; |
89 | double sx, sy; | 89 | double sx, sy; |
90 | swayc_t *swayc = | 90 | struct sway_container *swayc = |
91 | swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); | 91 | sway_container_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); |
92 | 92 | ||
93 | sway_seat_set_focus(cursor->seat, swayc); | 93 | sway_seat_set_focus(cursor->seat, swayc); |
94 | } | 94 | } |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 56b39766..f03a03b4 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -37,7 +37,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener, | |||
37 | struct sway_seat_container *seat_con = | 37 | struct sway_seat_container *seat_con = |
38 | wl_container_of(listener, seat_con, destroy); | 38 | wl_container_of(listener, seat_con, destroy); |
39 | struct sway_seat *seat = seat_con->seat; | 39 | struct sway_seat *seat = seat_con->seat; |
40 | swayc_t *con = seat_con->container; | 40 | struct sway_container *con = seat_con->container; |
41 | 41 | ||
42 | bool is_focus = (sway_seat_get_focus(seat) == con); | 42 | bool is_focus = (sway_seat_get_focus(seat) == con); |
43 | 43 | ||
@@ -46,7 +46,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener, | |||
46 | if (is_focus) { | 46 | if (is_focus) { |
47 | // pick next focus | 47 | // pick next focus |
48 | sway_seat_set_focus(seat, NULL); | 48 | sway_seat_set_focus(seat, NULL); |
49 | swayc_t *next = sway_seat_get_focus_inactive(seat, con->parent); | 49 | struct sway_container *next = sway_seat_get_focus_inactive(seat, con->parent); |
50 | if (next == NULL) { | 50 | if (next == NULL) { |
51 | next = con->parent; | 51 | next = con->parent; |
52 | } | 52 | } |
@@ -59,7 +59,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener, | |||
59 | } | 59 | } |
60 | 60 | ||
61 | static struct sway_seat_container *seat_container_from_container( | 61 | static struct sway_seat_container *seat_container_from_container( |
62 | struct sway_seat *seat, swayc_t *con) { | 62 | struct sway_seat *seat, struct sway_container *con) { |
63 | if (con->type < C_WORKSPACE) { | 63 | if (con->type < C_WORKSPACE) { |
64 | // these don't get seat containers ever | 64 | // these don't get seat containers ever |
65 | return NULL; | 65 | return NULL; |
@@ -89,11 +89,11 @@ static struct sway_seat_container *seat_container_from_container( | |||
89 | 89 | ||
90 | static void handle_new_container(struct wl_listener *listener, void *data) { | 90 | static void handle_new_container(struct wl_listener *listener, void *data) { |
91 | struct sway_seat *seat = wl_container_of(listener, seat, new_container); | 91 | struct sway_seat *seat = wl_container_of(listener, seat, new_container); |
92 | swayc_t *con = data; | 92 | struct sway_container *con = data; |
93 | seat_container_from_container(seat, con); | 93 | seat_container_from_container(seat, con); |
94 | } | 94 | } |
95 | 95 | ||
96 | static void collect_focus_iter(swayc_t *con, void *data) { | 96 | static void collect_focus_iter(struct sway_container *con, void *data) { |
97 | struct sway_seat *seat = data; | 97 | struct sway_seat *seat = data; |
98 | if (con->type > C_WORKSPACE) { | 98 | if (con->type > C_WORKSPACE) { |
99 | return; | 99 | return; |
@@ -130,7 +130,7 @@ struct sway_seat *sway_seat_create(struct sway_input_manager *input, | |||
130 | // init the focus stack | 130 | // init the focus stack |
131 | wl_list_init(&seat->focus_stack); | 131 | wl_list_init(&seat->focus_stack); |
132 | 132 | ||
133 | container_for_each_bfs(&root_container, collect_focus_iter, seat); | 133 | sway_container_for_each_bfs(&root_container, collect_focus_iter, seat); |
134 | 134 | ||
135 | wl_signal_add(&root_container.sway_root->events.new_container, | 135 | wl_signal_add(&root_container.sway_root->events.new_container, |
136 | &seat->new_container); | 136 | &seat->new_container); |
@@ -166,7 +166,7 @@ static void seat_configure_keyboard(struct sway_seat *seat, | |||
166 | sway_keyboard_configure(seat_device->keyboard); | 166 | sway_keyboard_configure(seat_device->keyboard); |
167 | wlr_seat_set_keyboard(seat->wlr_seat, | 167 | wlr_seat_set_keyboard(seat->wlr_seat, |
168 | seat_device->input_device->wlr_device); | 168 | seat_device->input_device->wlr_device); |
169 | swayc_t *focus = sway_seat_get_focus(seat); | 169 | struct sway_container *focus = sway_seat_get_focus(seat); |
170 | if (focus && focus->type == C_VIEW) { | 170 | if (focus && focus->type == C_VIEW) { |
171 | // force notify reenter to pick up the new configuration | 171 | // force notify reenter to pick up the new configuration |
172 | wlr_seat_keyboard_clear_focus(seat->wlr_seat); | 172 | wlr_seat_keyboard_clear_focus(seat->wlr_seat); |
@@ -270,7 +270,7 @@ void sway_seat_configure_xcursor(struct sway_seat *seat) { | |||
270 | } | 270 | } |
271 | 271 | ||
272 | for (int i = 0; i < root_container.children->length; ++i) { | 272 | for (int i = 0; i < root_container.children->length; ++i) { |
273 | swayc_t *output_container = root_container.children->items[i]; | 273 | struct sway_container *output_container = root_container.children->items[i]; |
274 | struct wlr_output *output = | 274 | struct wlr_output *output = |
275 | output_container->sway_output->wlr_output; | 275 | output_container->sway_output->wlr_output; |
276 | bool result = | 276 | bool result = |
@@ -289,8 +289,8 @@ void sway_seat_configure_xcursor(struct sway_seat *seat) { | |||
289 | seat->cursor->cursor->y); | 289 | seat->cursor->cursor->y); |
290 | } | 290 | } |
291 | 291 | ||
292 | void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) { | 292 | void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container) { |
293 | swayc_t *last_focus = sway_seat_get_focus(seat); | 293 | struct sway_container *last_focus = sway_seat_get_focus(seat); |
294 | 294 | ||
295 | if (container && last_focus == container) { | 295 | if (container && last_focus == container) { |
296 | return; | 296 | return; |
@@ -330,9 +330,9 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) { | |||
330 | seat->has_focus = (container != NULL); | 330 | seat->has_focus = (container != NULL); |
331 | } | 331 | } |
332 | 332 | ||
333 | swayc_t *sway_seat_get_focus_inactive(struct sway_seat *seat, swayc_t *container) { | 333 | struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat, struct sway_container *container) { |
334 | struct sway_seat_container *current = NULL; | 334 | struct sway_seat_container *current = NULL; |
335 | swayc_t *parent = NULL; | 335 | struct sway_container *parent = NULL; |
336 | wl_list_for_each(current, &seat->focus_stack, link) { | 336 | wl_list_for_each(current, &seat->focus_stack, link) { |
337 | parent = current->container->parent; | 337 | parent = current->container->parent; |
338 | 338 | ||
@@ -351,21 +351,21 @@ swayc_t *sway_seat_get_focus_inactive(struct sway_seat *seat, swayc_t *container | |||
351 | return NULL; | 351 | return NULL; |
352 | } | 352 | } |
353 | 353 | ||
354 | swayc_t *sway_seat_get_focus(struct sway_seat *seat) { | 354 | struct sway_container *sway_seat_get_focus(struct sway_seat *seat) { |
355 | if (!seat->has_focus) { | 355 | if (!seat->has_focus) { |
356 | return NULL; | 356 | return NULL; |
357 | } | 357 | } |
358 | return sway_seat_get_focus_inactive(seat, &root_container); | 358 | return sway_seat_get_focus_inactive(seat, &root_container); |
359 | } | 359 | } |
360 | 360 | ||
361 | swayc_t *sway_seat_get_focus_by_type(struct sway_seat *seat, | 361 | struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat, |
362 | enum swayc_types type) { | 362 | enum sway_container_type type) { |
363 | swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container); | 363 | struct sway_container *focus = sway_seat_get_focus_inactive(seat, &root_container); |
364 | if (focus->type == type) { | 364 | if (focus->type == type) { |
365 | return focus; | 365 | return focus; |
366 | } | 366 | } |
367 | 367 | ||
368 | return swayc_parent_by_type(focus, type); | 368 | return sway_container_parent(focus, type); |
369 | } | 369 | } |
370 | 370 | ||
371 | void sway_seat_set_config(struct sway_seat *seat, | 371 | void sway_seat_set_config(struct sway_seat *seat, |