diff options
author | Alexander Kurtakov <akurtako@redhat.com> | 2012-11-09 13:38:51 +0200 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2012-11-09 13:38:51 +0200 |
commit | 2bbc418c3915d70d87f9cd6fccfbf55e80a07cc5 (patch) | |
tree | cd63ecf925d72ff3223934289187f02b267a908d | |
parent | b620cf6cc88ddbd1317abb72e435ea48ca4572d3 (diff) | |
download | eclipse.platform.swt-2bbc418c3915d70d87f9cd6fccfbf55e80a07cc5.tar.gz eclipse.platform.swt-2bbc418c3915d70d87f9cd6fccfbf55e80a07cc5.tar.xz eclipse.platform.swt-2bbc418c3915d70d87f9cd6fccfbf55e80a07cc5.zip |
Load webkitgtk3 when running on GTK 3.x.
Trying to load webkitgtk 1.x on GTK 3 tries to init Gtk 2.x which locks
up the ui. Same approach as equinox launcher is used.
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h index 0c95804f0c..c3c9022280 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h +++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h @@ -18,15 +18,21 @@ #include <dlfcn.h> #include <string.h> +#include <stdlib.h> #include <glib-object.h> #define WebKitGTK_LOAD_FUNCTION(var, name) \ static int initialized = 0; \ static void *var = NULL; \ if (!initialized) { \ - void* handle = dlopen("libwebkit-1.0.so.2", LOAD_FLAGS); /* webkitgtk 1.2.x lib */ \ - if (!handle) { \ - handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk >= 1.4.x lib */ \ + void* handle ; \ + if (getenv("SWT_GTK3")) { \ + handle = dlopen("libwebkitgtk-3.0.so.0", LOAD_FLAGS); /* webkitgtk >= 3.x lib */ \ + } else { \ + handle = dlopen("libwebkit-1.0.so.2", LOAD_FLAGS); /* webkitgtk 1.2.x lib */ \ + if (!handle) { \ + handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk >= 1.4.x lib */ \ + } \ } \ if (handle) { \ var = dlsym(handle, #name); \ |