From d95c36a881fa2309243c6c56e0416842f5d60e59 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Tue, 13 Jun 2017 22:41:27 +0200
Subject: [PATCH] Keep xid generation and setting to env close together.

---
 src/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 7586f0c..5d01268 100644
--- a/src/main.c
+++ b/src/main.c
@@ -683,6 +683,10 @@ static Client *client_new(WebKitWebView *webview, gboolean show)
                 (int)GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(c->window))));
     }
 
+    /* set the x window id to env */
+    g_setenv("VIMB_XID", xid, TRUE);
+    g_free(xid);
+
     completion_init(c);
     map_init(c);
 
@@ -736,10 +740,6 @@ static Client *client_new(WebKitWebView *webview, gboolean show)
             GTK_STYLE_PROVIDER(vb.style_provider),
             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 
-    /* set the x window id to env */
-    g_setenv("VIMB_XID", xid, TRUE);
-    g_free(xid);
-
     /* initialize the settings */
     setting_init(c);
 
-- 
2.20.1