Merge pull request #1699 from acrisci/seat-fixes

Seat fixes and cleanup
This commit is contained in:
emersion 2018-04-02 15:24:25 -04:00 committed by GitHub
commit 0c0cc79282
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 248 additions and 194 deletions

View file

@ -157,17 +157,17 @@ void container_move_to(struct sway_container *container,
}
wl_signal_emit(&container->events.reparent, old_parent);
if (container->type == C_WORKSPACE) {
struct sway_seat *seat = sway_input_manager_get_default_seat(
struct sway_seat *seat = input_manager_get_default_seat(
input_manager);
if (old_parent->children->length == 0) {
char *ws_name = workspace_next_name(old_parent->name);
struct sway_container *ws =
container_workspace_create(old_parent, ws_name);
free(ws_name);
sway_seat_set_focus(seat, ws);
seat_set_focus(seat, ws);
}
container_sort_workspaces(new_parent);
sway_seat_set_focus(seat, new_parent);
seat_set_focus(seat, new_parent);
}
if (old_parent) {
arrange_windows(old_parent, -1, -1);
@ -430,7 +430,7 @@ static struct sway_container *get_swayc_in_output_direction(
return NULL;
}
struct sway_container *ws = sway_seat_get_focus_inactive(seat, output);
struct sway_container *ws = seat_get_focus_inactive(seat, output);
if (ws->type != C_WORKSPACE) {
ws = container_parent(ws, C_WORKSPACE);
}
@ -451,7 +451,7 @@ static struct sway_container *get_swayc_in_output_direction(
case MOVE_UP:
case MOVE_DOWN: {
struct sway_container *focused =
sway_seat_get_focus_inactive(seat, ws);
seat_get_focus_inactive(seat, ws);
if (focused && focused->parent) {
struct sway_container *parent = focused->parent;
if (parent->layout == L_VERT) {
@ -535,7 +535,7 @@ static struct sway_container *get_swayc_in_direction_under(
struct sway_container *container, enum movement_direction dir,
struct sway_seat *seat, struct sway_container *limit) {
if (dir == MOVE_CHILD) {
return sway_seat_get_focus_inactive(seat, container);
return seat_get_focus_inactive(seat, container);
}
struct sway_container *parent = container->parent;
@ -595,7 +595,7 @@ static struct sway_container *get_swayc_in_direction_under(
}
if (next->children && next->children->length) {
// TODO consider floating children as well
return sway_seat_get_focus_inactive(seat, next);
return seat_get_focus_inactive(seat, next);
} else {
return next;
}