From 2bbc418c3915d70d87f9cd6fccfbf55e80a07cc5 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 9 Nov 2012 13:38:51 +0200 Subject: 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. --- .../Eclipse SWT WebKit/gtk/library/webkitgtk.h | 12 +++++++++--- 1 file 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 #include +#include #include #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); \ -- cgit