aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2019-02-22 06:42:40 +0100
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-02-22 00:52:57 -0500
commit16ddd00102c7713b7d1c404393768eb06c829751 (patch)
tree5c0659deff6277e6487b2a130afd30c19b7c69d0 /sway/commands/move.c
parentHandle NULL from output_get_active_workspace (diff)
downloadsway-16ddd00102c7713b7d1c404393768eb06c829751.tar.gz
sway-16ddd00102c7713b7d1c404393768eb06c829751.tar.zst
sway-16ddd00102c7713b7d1c404393768eb06c829751.zip
commands/move: reintroduce wrongly removed NULL check
Commit d3d7956576341bbbfb60d045175b0e8a44752e0b removed this NULL check, which leads to the following backtrace: #0 0x0000557bd201df46 in node_is_view (node=0x0) at ../sway/sway/tree/node.c:41 #1 0x0000557bd1ff5d4e in seat_get_focus_inactive (seat=0x557bd3fc7580, node=0x0) at ../sway/sway/input/seat.c:968 current = 0x557bd2033485 #2 0x0000557bd2009f24 in cmd_move_container (argc=3, argv=0x557bd46b19c0) at ../sway/sway/commands/move.c:557 new_output_last_focus = 0x0 error = 0x0 node = 0x557bd469f360 workspace = 0x557bd4572ee0 container = 0x557bd469f360 no_auto_back_and_forth = false seat = 0x557bd3fc7580 old_parent = 0x0 old_ws = 0x557bd4572ee0 old_output = 0x557bd411f740 destination = 0x557bd46a0cc0 new_output = 0x557bd411f740 new_output_last_ws = 0x0 focus = 0x557bd469f360 __PRETTY_FUNCTION__ = "cmd_move_container" new_workspace = 0x557bd4572ee0 […] Reintroduce the NULL check to fix the bug. Fixes #3746
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r--sway/commands/move.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index d4fb9022..b593138a 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -552,7 +552,7 @@ static struct cmd_results *cmd_move_container(int argc, char **argv) {
552 return cmd_results_new(CMD_FAILURE, 552 return cmd_results_new(CMD_FAILURE,
553 "Expected output to have a workspace"); 553 "Expected output to have a workspace");
554 } 554 }
555 if (new_output_last_ws != new_workspace) { 555 if (new_output_last_ws && new_output_last_ws != new_workspace) {
556 struct sway_node *new_output_last_focus = 556 struct sway_node *new_output_last_focus =
557 seat_get_focus_inactive(seat, &new_output_last_ws->node); 557 seat_get_focus_inactive(seat, &new_output_last_ws->node);
558 seat_set_raw_focus(seat, new_output_last_focus); 558 seat_set_raw_focus(seat, new_output_last_focus);