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: