Merge pull request #2613 from apreiml/fix_no_last_focus_fail

handle_layer_shell_surface: Do not crash if seat doesn't have focus
This commit is contained in:
emersion 2018-09-10 13:56:02 +02:00 committed by GitHub
commit 024b9d85ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -337,7 +337,10 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
struct sway_seat *seat = input_manager_get_default_seat(input_manager); struct sway_seat *seat = input_manager_get_default_seat(input_manager);
if (seat) { if (seat) {
struct sway_workspace *ws = seat_get_focused_workspace(seat); struct sway_workspace *ws = seat_get_focused_workspace(seat);
output = ws->output;
if (ws != NULL) {
output = ws->output;
}
} }
if (!output) { if (!output) {
if (!sway_assert(root->outputs->length, if (!sway_assert(root->outputs->length,