From 48cc91881fabe6090deaff9e4998f89134ee1fcc Mon Sep 17 00:00:00 2001 From: Arun Thondapu Date: Mon, 3 Mar 2014 20:34:27 +0530 Subject: Bug 421127 - All views empty with GTK 3.10 Fall back to GTK+ 2 for GTK+ 3 versions > 3.9.0 till we have a proper fix for the bug in place so that Eclipse is usable Change-Id: I1a35bb3963e404d4a4c45e16d254aca3ae762a7d Signed-off-by: Arun Thondapu --- .../library/gtk/eclipseGtkInit.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c index 996c9ef75..6a5d5e29b 100644 --- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c +++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c @@ -106,6 +106,20 @@ int loadGtk() { if (gtk3 == NULL || strcmp(gtk3,"1") == 0) { gdkLib = dlopen(GDK3_LIB, DLFLAGS); gtkLib = dlopen(GTK3_LIB, DLFLAGS); + if (gtkLib != NULL) { + const char * (*func)(int, int, int); + dlerror(); + *(void**) (&func) = dlsym(gtkLib, "gtk_check_version"); + if (dlerror() == NULL && func) { + const char *check = (*func)(3, 9, 0); + if (check == NULL) { + dlclose(gdkLib); + dlclose(gtkLib); + gdkLib = gtkLib = NULL; + setenv("SWT_GTK3","0",1); + } + } + } } if (!gtkLib || !gdkLib) { gdkLib = dlopen(GDK_LIB, DLFLAGS); -- cgit v1.2.3