From 9190b2a455ffa6f95d9396bb699b2aaa67b08e64 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 21 Dec 2022 14:59:40 +0100 Subject: main: fix compilation with FEATURE_NO_XEMBED When FEATURE_NO_XEMBED is defined then we don't support using the Xembed interface, which will cause us to set the `VIMB_XID` envvar. With 55fb9cc (Add new env VIMB_WIN_ID to hold the gtk window id., 2021-01-25) a related feature was added that causes us to expose the Gtk window ID via the `VIMB_WIN_ID` environment variable. This feature also depends on X-specific information because it uses `GDK_WINDOW_XID()` to derive the window ID. This change thus broke Wayland-only environments. Fix compilation by extending the `ifdef` to guard the logic that both sets the `VIMB_XID` and the `VIMB_WIN_ID`. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index cbd6b0f..6475cd0 100644 --- a/src/main.c +++ b/src/main.c @@ -824,10 +824,10 @@ static void client_show(WebKitWebView *webview, Client *c) gtk_widget_show_all(c->window); +#ifndef FEATURE_NO_XEMBED char *wid; wid = g_strdup_printf("%d", (int)GDK_WINDOW_XID(gtk_widget_get_window(c->window))); g_setenv("neovimb_WIN_ID", wid, TRUE); -#ifndef FEATURE_NO_XEMBED /* set the x window id to env */ if (vb.embed) { char *xid; @@ -837,8 +837,8 @@ static void client_show(WebKitWebView *webview, Client *c) } else { g_setenv("neovimb_XID", wid, TRUE); } -#endif g_free(wid); +#endif /* start client in normal mode */ vb_enter(c, 'n'); -- cgit v1.2.3