aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-09 17:45:43 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-09 17:45:43 +0000
commit404365ec56dd3e238be46946dd15a229a64bf154 (patch)
treef00f4d085f99fabd7fa78ac6949c41657f49c0b5
parent.desktop: 'terminal' is not a common icon name (diff)
wayland: register FDM hook early, to avoid unregister errors when failing
-rw-r--r--wayland.c10
1 files 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: