summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2022-12-21 14:59:40 +0100
committerRafael Marçalo <raroma09@gmail.com>2023-01-03 15:08:00 +0000
commit9190b2a455ffa6f95d9396bb699b2aaa67b08e64 (patch)
treeb8d777076e3abf8d2c4e17b8f818a73fbc5851b6 /src
parentd6e778052cd923d77d29307850b24e0ebcb8a8ab (diff)
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`.
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files 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');