Merge pull request #428 from emersion/fix-disabled-xwayland

Fix segfault when xwayland is disabled
This commit is contained in:
Drew DeVault 2017-11-17 09:31:31 -05:00 committed by GitHub
commit bf5640db12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -58,8 +58,12 @@ int main(int argc, char **argv) {
#ifndef HAS_XWAYLAND
ready(NULL, NULL);
#else
struct wl_listener xwayland_ready = { .notify = ready };
wl_signal_add(&server.desktop->xwayland->events.ready, &xwayland_ready);
if (server.desktop->xwayland != NULL) {
struct wl_listener xwayland_ready = { .notify = ready };
wl_signal_add(&server.desktop->xwayland->events.ready, &xwayland_ready);
} else {
ready(NULL, NULL);
}
#endif
wl_display_run(server.wl_display);