summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2021-01-25 22:51:40 +0100
committerDaniel Carl <danielcarl@gmx.de>2021-01-25 22:51:40 +0100
commit55fb9cc58a1c8fc675b2df4a10e0f99b264f4a40 (patch)
treee40af2d7d88063ebc1c4d2a87d21f90981e67459 /src/main.c
parent1255049e514dadfc151713b5f0b93e00ad5f3db2 (diff)
Add new env VIMB_WIN_ID to hold the gtk window id.
Fixes #658.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 07620b3..da81026 100644
--- a/src/main.c
+++ b/src/main.c
@@ -770,9 +770,6 @@ static Client *client_new(WebKitWebView *webview)
static void client_show(WebKitWebView *webview, Client *c)
{
GtkWidget *box;
-#ifndef FEATURE_NO_XEMBED
- char *xid;
-#endif
c->window = create_window(c);
@@ -822,17 +819,22 @@ static void client_show(WebKitWebView *webview, Client *c)
setting_init(c);
gtk_widget_show_all(c->window);
+
+ char *wid;
+ wid = g_strdup_printf("%d", (int)GDK_WINDOW_XID(gtk_widget_get_window(c->window)));
+ g_setenv("VIMB_WIN_ID", wid, TRUE);
#ifndef FEATURE_NO_XEMBED
+ /* set the x window id to env */
if (vb.embed) {
+ char *xid;
xid = g_strdup_printf("%d", (int)vb.embed);
+ g_setenv("VIMB_XID", xid, TRUE);
+ g_free(xid);
} else {
- xid = g_strdup_printf("%d", (int)GDK_WINDOW_XID(gtk_widget_get_window(c->window)));
+ g_setenv("VIMB_XID", wid, TRUE);
}
-
- /* set the x window id to env */
- g_setenv("VIMB_XID", xid, TRUE);
- g_free(xid);
#endif
+ g_free(wid);
/* start client in normal mode */
vb_enter(c, 'n');