From 404365ec56dd3e238be46946dd15a229a64bf154 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 9 Mar 2020 18:45:43 +0100 Subject: wayland: register FDM hook early, to avoid unregister errors when failing --- wayland.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index 4bf77562..f06668ac 100644 --- a/wayland.c +++ b/wayland.c @@ -727,6 +727,11 @@ wayl_init(const struct config *conf, struct fdm *fdm) wayl->fdm = fdm; wayl->kbd.repeat.fd = -1; + if (!fdm_hook_add(fdm, &fdm_hook, wayl, FDM_HOOK_PRIORITY_LOW)) { + LOG_ERR("failed to add FDM hook"); + goto out; + } + wayl->display = wl_display_connect(NULL); if (wayl->display == NULL) { LOG_ERR("failed to connect to wayland; no compositor running?"); @@ -851,11 +856,6 @@ wayl_init(const struct config *conf, struct fdm *fdm) goto out; } - if (!fdm_hook_add(fdm, &fdm_hook, wayl, FDM_HOOK_PRIORITY_LOW)) { - LOG_ERR("failed to add FDM hook"); - goto out; - } - return wayl; out: -- cgit v1.3 From 3e5f011f7571fdbe45d143049d0e49620eadbef9 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 9 Mar 2020 18:46:09 +0100 Subject: wayland: make a missing presentation time interface an error If the user wanted to do presentation timing, and the interface isn't there, then this is an error. --- wayland.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index f06668ac..0baafa28 100644 --- a/wayland.c +++ b/wayland.c @@ -780,9 +780,10 @@ wayl_init(const struct config *conf, struct fdm *fdm) if (wayl->primary_selection_device_manager == NULL) LOG_WARN("no primary selection available"); - if (conf->presentation_timings && wayl->presentation == NULL) - LOG_WARN("presentation time interface not implemented by compositor; " - "timings will not be available"); + if (conf->presentation_timings && wayl->presentation == NULL) { + LOG_ERR("presentation time interface not implemented by compositor"); + goto out; + } tll_foreach(wayl->monitors, it) { LOG_INFO( -- cgit v1.3