diff options
author | Antonin Décimo <antonin.decimo@gmail.com> | 2019-08-10 17:03:20 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-08-12 09:42:11 +0900 |
commit | 813e1209795f7016fd1223c5ce96b2185eed5a9a (patch) | |
tree | 892eeea5d2ae14f4a18e6dc74fdc0703bb124e4b | |
parent | Fix memory leaks (diff) | |
download | sway-813e1209795f7016fd1223c5ce96b2185eed5a9a.tar.gz sway-813e1209795f7016fd1223c5ce96b2185eed5a9a.tar.zst sway-813e1209795f7016fd1223c5ce96b2185eed5a9a.zip |
Remove redundant checks
-rw-r--r-- | sway/commands/border.c | 2 | ||||
-rw-r--r-- | sway/commands/fullscreen.c | 2 | ||||
-rw-r--r-- | sway/input/seatop_default.c | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/sway/commands/border.c b/sway/commands/border.c index 6be5b794..647663ac 100644 --- a/sway/commands/border.c +++ b/sway/commands/border.c | |||
@@ -75,7 +75,7 @@ struct cmd_results *cmd_border(int argc, char **argv) { | |||
75 | } else if (strcmp(argv[0], "pixel") == 0) { | 75 | } else if (strcmp(argv[0], "pixel") == 0) { |
76 | set_border(container, B_PIXEL); | 76 | set_border(container, B_PIXEL); |
77 | } else if (strcmp(argv[0], "csd") == 0) { | 77 | } else if (strcmp(argv[0], "csd") == 0) { |
78 | if (!view || !view->xdg_decoration) { | 78 | if (!view->xdg_decoration) { |
79 | return cmd_results_new(CMD_INVALID, | 79 | return cmd_results_new(CMD_INVALID, |
80 | "This window doesn't support client side decorations"); | 80 | "This window doesn't support client side decorations"); |
81 | } | 81 | } |
diff --git a/sway/commands/fullscreen.c b/sway/commands/fullscreen.c index 0d7ba112..3392a7f7 100644 --- a/sway/commands/fullscreen.c +++ b/sway/commands/fullscreen.c | |||
@@ -35,7 +35,7 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) { | |||
35 | 35 | ||
36 | bool is_fullscreen = false; | 36 | bool is_fullscreen = false; |
37 | for (struct sway_container *curr = container; curr; curr = curr->parent) { | 37 | for (struct sway_container *curr = container; curr; curr = curr->parent) { |
38 | if (curr && curr->fullscreen_mode != FULLSCREEN_NONE) { | 38 | if (curr->fullscreen_mode != FULLSCREEN_NONE) { |
39 | container = curr; | 39 | container = curr; |
40 | is_fullscreen = true; | 40 | is_fullscreen = true; |
41 | break; | 41 | break; |
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index e3726dd1..11382276 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c | |||
@@ -334,8 +334,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
334 | if (cont && is_floating_or_child && !is_fullscreen_or_child && | 334 | if (cont && is_floating_or_child && !is_fullscreen_or_child && |
335 | state == WLR_BUTTON_PRESSED) { | 335 | state == WLR_BUTTON_PRESSED) { |
336 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; | 336 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; |
337 | if (button == btn_move && state == WLR_BUTTON_PRESSED && | 337 | if (button == btn_move && (mod_pressed || on_titlebar)) { |
338 | (mod_pressed || on_titlebar)) { | ||
339 | while (cont->parent) { | 338 | while (cont->parent) { |
340 | cont = cont->parent; | 339 | cont = cont->parent; |
341 | } | 340 | } |