summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonin Décimo <antonin.decimo@gmail.com>2019-08-10 17:03:20 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-20 13:27:52 +0900
commitd9c09c483ad6a03f66db231556a68a35f3654956 (patch)
tree892eeea5d2ae14f4a18e6dc74fdc0703bb124e4b
parent64cfe746ab9a0158d18e7a3d5eedca3d94e80fec (diff)
Remove redundant checks
-rw-r--r--sway/commands/border.c2
-rw-r--r--sway/commands/fullscreen.c2
-rw-r--r--sway/input/seatop_default.c3
3 files changed, 3 insertions, 4 deletions
diff --git a/sway/commands/border.c b/sway/commands/border.c
index 6be5b7948..647663acf 100644
--- a/sway/commands/border.c
+++ b/sway/commands/border.c
@@ -75,7 +75,7 @@ struct cmd_results *cmd_border(int argc, char **argv) {
} else if (strcmp(argv[0], "pixel") == 0) {
set_border(container, B_PIXEL);
} else if (strcmp(argv[0], "csd") == 0) {
- if (!view || !view->xdg_decoration) {
+ if (!view->xdg_decoration) {
return cmd_results_new(CMD_INVALID,
"This window doesn't support client side decorations");
}
diff --git a/sway/commands/fullscreen.c b/sway/commands/fullscreen.c
index 0d7ba112f..3392a7f7b 100644
--- a/sway/commands/fullscreen.c
+++ b/sway/commands/fullscreen.c
@@ -35,7 +35,7 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
bool is_fullscreen = false;
for (struct sway_container *curr = container; curr; curr = curr->parent) {
- if (curr && curr->fullscreen_mode != FULLSCREEN_NONE) {
+ if (curr->fullscreen_mode != FULLSCREEN_NONE) {
container = curr;
is_fullscreen = true;
break;
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index e3726dd1c..11382276b 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,
if (cont && is_floating_or_child && !is_fullscreen_or_child &&
state == WLR_BUTTON_PRESSED) {
uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT;
- if (button == btn_move && state == WLR_BUTTON_PRESSED &&
- (mod_pressed || on_titlebar)) {
+ if (button == btn_move && (mod_pressed || on_titlebar)) {
while (cont->parent) {
cont = cont->parent;
}