mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Fix potential null accesses
This commit is contained in:
parent
e7d6b8ec3e
commit
913445e112
2 changed files with 54 additions and 48 deletions
|
@ -311,6 +311,7 @@ static bool container_move_in_direction(struct sway_container *container,
|
|||
|
||||
while (current) {
|
||||
list_t *siblings = container_get_siblings(current);
|
||||
if (siblings) {
|
||||
enum sway_container_layout layout = container_parent_layout(current);
|
||||
int index = list_find(siblings, current);
|
||||
int desired = index + offs;
|
||||
|
@ -344,12 +345,14 @@ static bool container_move_in_direction(struct sway_container *container,
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
current = current->parent;
|
||||
}
|
||||
|
||||
// Maybe rejigger the workspace
|
||||
struct sway_workspace *ws = container->workspace;
|
||||
if (ws) {
|
||||
if (!is_parallel(ws->layout, move_dir)) {
|
||||
workspace_rejigger(ws, container, move_dir);
|
||||
return true;
|
||||
|
@ -370,6 +373,7 @@ static bool container_move_in_direction(struct sway_container *container,
|
|||
return true;
|
||||
}
|
||||
sway_log(SWAY_DEBUG, "Hit edge of output, nowhere else to go");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1194,6 +1194,7 @@ void seat_consider_warp_to_focus(struct sway_seat *seat) {
|
|||
}
|
||||
if (config->mouse_warping == WARP_OUTPUT) {
|
||||
struct sway_output *output = node_get_output(focus);
|
||||
if (output) {
|
||||
struct wlr_box box;
|
||||
output_get_box(output, &box);
|
||||
if (wlr_box_contains_point(&box,
|
||||
|
@ -1201,6 +1202,7 @@ void seat_consider_warp_to_focus(struct sway_seat *seat) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (focus->type == N_CONTAINER) {
|
||||
cursor_warp_to_container(seat->cursor, focus->sway_container);
|
||||
|
|
Loading…
Reference in a new issue