diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-04 23:06:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 23:06:42 -0400 |
commit | 891e1148bee2575522312078f96eb4c41af49c6c (patch) | |
tree | 3044fb62120ca23499d31275076af50db09a9850 /sway/tree | |
parent | 21aedf15052df4e7f8ee72922fa0e214d690facc (diff) | |
parent | 65f254f3fbc83d006d4ec29170ec8a8695345d6c (diff) |
Merge pull request #1733 from acrisci/fix-focus-inactive
try to fix focus-inactive
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 12 | ||||
-rw-r--r-- | sway/tree/layout.c | 10 |
2 files changed, 14 insertions, 8 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index bd9f1edf..8fc9e3e8 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -53,10 +53,16 @@ const char *container_type_to_str(enum sway_container_type type) { void container_create_notify(struct sway_container *container) { // TODO send ipc event type based on the container type wl_signal_emit(&root_container.sway_root->events.new_container, container); - ipc_event_window(container, "new"); + + if (container->type == C_VIEW || container->type == C_CONTAINER) { + ipc_event_window(container, "new"); + } } static void container_close_notify(struct sway_container *container) { + if (container == NULL) { + return; + } // TODO send ipc event type based on the container type ipc_event_window(container, "close"); } @@ -506,8 +512,8 @@ static bool find_child_func(struct sway_container *con, void *data) { bool container_has_child(struct sway_container *con, struct sway_container *child) { - if (child == NULL || child->type == C_VIEW || - child->children->length == 0) { + if (con == NULL || con->type == C_VIEW || + con->children->length == 0) { return false; } return container_find(con, find_child_func, child); diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 5abdbc32..1769609b 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -638,16 +638,16 @@ struct sway_container *container_get_in_direction( wrap_candidate = parent->children->items[0]; } if (config->force_focus_wrapping) { - return seat_get_focus_by_type(seat, - wrap_candidate, C_VIEW); + return wrap_candidate; } } } else { + struct sway_container *desired_con = parent->children->items[desired]; wlr_log(L_DEBUG, "cont %d-%p dir %i sibling %d: %p", idx, - container, dir, desired, parent->children->items[desired]); - return seat_get_focus_by_type(seat, - parent->children->items[desired], C_VIEW); + container, dir, desired, desired_con); + struct sway_container *next = seat_get_focus_by_type(seat, desired_con, C_VIEW); + return next; } } |