summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2017-02-12 18:50:31 +0100
committerQuentin Rameau <quinq@fifth.space>2017-03-22 17:20:36 +0100
commit7e02344a615a61246ccce1c7f770e88fbd57756e (patch)
treecb8badf6ea7abf4fb6abbc2bd14da0f2e68a3d17 /surf.c
parent1abb2ebe7a90eea6e82415a07e0f2ea6e3475e5f (diff)
downloadsurf-7e02344a615a61246ccce1c7f770e88fbd57756e.tar.gz
surf-7e02344a615a61246ccce1c7f770e88fbd57756e.tar.bz2
surf-7e02344a615a61246ccce1c7f770e88fbd57756e.zip
Install Atoms before initializing gtk
There a race condition in gtkplug/socket which is raised when setting Atoms. Use this workaround until https://bugzilla.gnome.org/show_bug.cgi?id=778680 is fixed.
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/surf.c b/surf.c
index cd0a13c..93a1629 100644
--- a/surf.c
+++ b/surf.c
@@ -271,18 +271,20 @@ setup(void)
if (signal(SIGHUP, sighup) == SIG_ERR)
die("Can't install SIGHUP handler");
- gtk_init(NULL, NULL);
-
- gdpy = gdk_display_get_default();
- dpy = GDK_DISPLAY_XDISPLAY(gdpy);
-
- curconfig = defconfig;
+ if (!(dpy = XOpenDisplay(NULL)))
+ die("Can't open default display");
/* atoms */
atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False);
atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False);
atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False);
+ gtk_init(NULL, NULL);
+
+ gdpy = gdk_display_get_default();
+
+ curconfig = defconfig;
+
/* dirs and files */
cookiefile = buildfile(cookiefile);
scriptfile = buildfile(scriptfile);
@@ -901,6 +903,7 @@ cleanup(void)
g_free(scriptfile);
g_free(stylefile);
g_free(cachedir);
+ XCloseDisplay(dpy);
}
WebKitWebView *