From 404365ec56dd3e238be46946dd15a229a64bf154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 9 Mar 2020 18:45:43 +0100 Subject: [PATCH] wayland: register FDM hook early, to avoid unregister errors when failing --- wayland.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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: