Terminate local display on remote X11 server error

This commit is contained in:
emersion 2017-11-16 09:38:24 +01:00
parent 73c48f2f35
commit 7d847efe40
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 11 additions and 6 deletions

View file

@ -41,7 +41,7 @@ static bool wlr_wl_backend_start(struct wlr_backend *_backend) {
wlr_log(L_INFO, "Initializating wayland backend");
wlr_wl_registry_poll(backend);
if (!(backend->compositor) || (!(backend->shell))) {
if (!backend->compositor || !backend->shell) {
wlr_log_errno(L_ERROR, "Could not obtain retrieve required globals");
return false;
}
@ -54,10 +54,9 @@ static bool wlr_wl_backend_start(struct wlr_backend *_backend) {
struct wl_event_loop *loop = wl_display_get_event_loop(backend->local_display);
int fd = wl_display_get_fd(backend->remote_display);
int events = WL_EVENT_READABLE | WL_EVENT_ERROR |
WL_EVENT_HANGUP;
int events = WL_EVENT_READABLE | WL_EVENT_ERROR | WL_EVENT_HANGUP;
backend->remote_display_src = wl_event_loop_add_fd(loop, fd, events,
dispatch_events, backend);
dispatch_events, backend);
wl_event_source_check(backend->remote_display_src);
return true;