Fix segfaults when focusing a workspace

This commit is contained in:
emersion 2018-03-30 16:12:02 -04:00
parent 03255fd202
commit eb716c6c43
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 21 additions and 10 deletions

View file

@ -390,7 +390,7 @@ static void ipc_get_workspaces_callback(struct sway_container *workspace,
struct sway_seat *seat =
sway_input_manager_get_default_seat(input_manager);
struct sway_container *focused_ws = sway_seat_get_focus(seat);
if (focused_ws->type != C_WORKSPACE) {
if (focused_ws != NULL && focused_ws->type != C_WORKSPACE) {
focused_ws = container_parent(focused_ws, C_WORKSPACE);
}
bool focused = workspace == focused_ws;