summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-28 11:14:59 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-28 11:14:59 -0700
commit28c22c8f8044355ffe89328b1af75a7e36b8dfea (patch)
treef1cc2f6f04aa021fa21ceaa4ab0753066f5ff239
parentlayout fix for a certain case (diff)
downloadsway-28c22c8f8044355ffe89328b1af75a7e36b8dfea.tar.gz
sway-28c22c8f8044355ffe89328b1af75a7e36b8dfea.tar.zst
sway-28c22c8f8044355ffe89328b1af75a7e36b8dfea.zip
style
-rw-r--r--sway/commands.c12
-rw-r--r--sway/layout.c3
2 files changed, 7 insertions, 8 deletions
diff --git a/sway/commands.c b/sway/commands.c
index cd010913..de98b624 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -209,7 +209,7 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
209 destroy_container(remove_child(view)); 209 destroy_container(remove_child(view));
210 210
211 // and move it into workspace floating 211 // and move it into workspace floating
212 add_floating(swayc_active_workspace(),view); 212 add_floating(swayc_active_workspace(), view);
213 view->x = (swayc_active_workspace()->width - view->width)/2; 213 view->x = (swayc_active_workspace()->width - view->width)/2;
214 view->y = (swayc_active_workspace()->height - view->height)/2; 214 view->y = (swayc_active_workspace()->height - view->height)/2;
215 if (view->desired_width != -1) { 215 if (view->desired_width != -1) {
@@ -351,13 +351,13 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) {
351 swayc_t *view = get_focused_container(&root_container); 351 swayc_t *view = get_focused_container(&root_container);
352 352
353 if (strcasecmp(argv[0], "left") == 0) { 353 if (strcasecmp(argv[0], "left") == 0) {
354 move_container(view,MOVE_LEFT); 354 move_container(view, MOVE_LEFT);
355 } else if (strcasecmp(argv[0], "right") == 0) { 355 } else if (strcasecmp(argv[0], "right") == 0) {
356 move_container(view,MOVE_RIGHT); 356 move_container(view, MOVE_RIGHT);
357 } else if (strcasecmp(argv[0], "up") == 0) { 357 } else if (strcasecmp(argv[0], "up") == 0) {
358 move_container(view,MOVE_UP); 358 move_container(view, MOVE_UP);
359 } else if (strcasecmp(argv[0], "down") == 0) { 359 } else if (strcasecmp(argv[0], "down") == 0) {
360 move_container(view,MOVE_DOWN); 360 move_container(view, MOVE_DOWN);
361 } else if (strcasecmp(argv[0], "container") == 0 || strcasecmp(argv[0], "window") == 0) { 361 } else if (strcasecmp(argv[0], "container") == 0 || strcasecmp(argv[0], "window") == 0) {
362 // "move container to workspace x" 362 // "move container to workspace x"
363 if (!checkarg(argc, "move container/window", EXPECTED_EQUAL_TO, 4) || 363 if (!checkarg(argc, "move container/window", EXPECTED_EQUAL_TO, 4) ||
@@ -389,7 +389,7 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) {
389} 389}
390 390
391static bool cmd_orientation(struct sway_config *config, int argc, char **argv) { 391static bool cmd_orientation(struct sway_config *config, int argc, char **argv) {
392 if (strcasecmp(argv[0],"horizontal") == 0) { 392 if (strcasecmp(argv[0], "horizontal") == 0) {
393 config->default_orientation = L_HORIZ; 393 config->default_orientation = L_HORIZ;
394 } else if (strcasecmp(argv[0], "vertical") == 0) { 394 } else if (strcasecmp(argv[0], "vertical") == 0) {
395 config->default_orientation = L_VERT; 395 config->default_orientation = L_VERT;
diff --git a/sway/layout.c b/sway/layout.c
index 1f423099..103ede52 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -515,8 +515,7 @@ swayc_t *get_swayc_in_direction_under(swayc_t *container, enum movement_directio
515 can_move = true; 515 can_move = true;
516 diff = target - self; 516 diff = target - self;
517 } 517 }
518 } 518 } else {
519 else {
520 if (dir == MOVE_LEFT || dir == MOVE_RIGHT) { 519 if (dir == MOVE_LEFT || dir == MOVE_RIGHT) {
521 if (parent->layout == L_HORIZ) { 520 if (parent->layout == L_HORIZ) {
522 can_move = true; 521 can_move = true;