diff options
author | taiyu <taiyu.len@gmail.com> | 2015-09-29 07:19:10 -0700 |
---|---|---|
committer | taiyu <taiyu.len@gmail.com> | 2015-09-29 07:19:10 -0700 |
commit | c963aa7ceda5f5a5ea5d648ec291d62b74e84ac9 (patch) | |
tree | 92178627be2ef7e5d651bfaf075c3af52065697e | |
parent | fe3b85d65ff84133cfbe43c11a5462beddbefaff (diff) |
return after disconnect ipc client and minor checks
-rw-r--r-- | sway/ipc.c | 2 | ||||
-rw-r--r-- | sway/resize.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -253,7 +253,7 @@ void ipc_client_handle_command(struct ipc_client *client) { default: sway_log(L_INFO, "Unknown IPC command type %i", client->current_command); ipc_client_disconnect(client); - break; + return; } client->payload_length = 0; diff --git a/sway/resize.c b/sway/resize.c index 22d520af..f1b1f4ae 100644 --- a/sway/resize.c +++ b/sway/resize.c @@ -20,7 +20,7 @@ bool resize_tiled(int amount, bool use_width) { int lnumber = 0; int rnumber = 0; while (parent->parent) { - if (parent->parent->layout == L_HORIZ) { + if (parent->parent->layout == L_HORIZ && parent->parent->children) { for (i = 0; i < parent->parent->children->length; i++) { sibling = parent->parent->children->items[i]; if (sibling->x != focused->x) { @@ -143,7 +143,7 @@ bool resize_tiled(int amount, bool use_width) { } parent = parent->parent; } - if (parent == &root_container) { + if (parent->parent == NULL || parent->parent->children == NULL) { return true; } sway_log(L_DEBUG, "Found the proper parent: %p. It has %d b conts, and %d t conts", parent->parent, bnumber, tnumber); |