diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-03-29 18:29:34 +1000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-29 09:26:06 -0600 |
commit | 2cae0d5e3a9c5abc7c2aa2aad4021c86730b2ec9 (patch) | |
tree | 8aa61c7047978e48b89f82a3d95248e0d701b4a3 | |
parent | bindings: fix overwrite log argument mismatch (diff) | |
download | sway-2cae0d5e3a9c5abc7c2aa2aad4021c86730b2ec9.tar.gz sway-2cae0d5e3a9c5abc7c2aa2aad4021c86730b2ec9.tar.zst sway-2cae0d5e3a9c5abc7c2aa2aad4021c86730b2ec9.zip |
Fix null pointer crash when doing tiling drag
* Create layout S[V[view view] view]
* Drag bottom view to the top
* Sway would crash when the cursor hovers the V[view view] title while
dragging
-rw-r--r-- | sway/input/seatop_move_tiling.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c index 0a248091..64a16c09 100644 --- a/sway/input/seatop_move_tiling.c +++ b/sway/input/seatop_move_tiling.c | |||
@@ -108,7 +108,7 @@ static void handle_motion_postthreshold(struct sway_seat *seat) { | |||
108 | } | 108 | } |
109 | 109 | ||
110 | if (node->type == N_WORKSPACE) { | 110 | if (node->type == N_WORKSPACE) { |
111 | // Emtpy workspace | 111 | // Empty workspace |
112 | e->target_node = node; | 112 | e->target_node = node; |
113 | e->target_edge = WLR_EDGE_NONE; | 113 | e->target_edge = WLR_EDGE_NONE; |
114 | workspace_get_box(node->sway_workspace, &e->drop_box); | 114 | workspace_get_box(node->sway_workspace, &e->drop_box); |
@@ -164,7 +164,7 @@ static void handle_motion_postthreshold(struct sway_seat *seat) { | |||
164 | 164 | ||
165 | // Use the hovered view - but we must be over the actual surface | 165 | // Use the hovered view - but we must be over the actual surface |
166 | con = node->sway_container; | 166 | con = node->sway_container; |
167 | if (!con->view->surface || node == &e->con->node | 167 | if (!con->view || !con->view->surface || node == &e->con->node |
168 | || node_has_ancestor(node, &e->con->node)) { | 168 | || node_has_ancestor(node, &e->con->node)) { |
169 | e->target_node = NULL; | 169 | e->target_node = NULL; |
170 | e->target_edge = WLR_EDGE_NONE; | 170 | e->target_edge = WLR_EDGE_NONE; |