diff options
author | Sravan Kumar Lakkimsetti | 2015-05-22 10:50:48 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2015-05-26 13:31:10 +0000 |
commit | db53ed0dece0186f5ea1adad05151206f8f259ce (patch) | |
tree | 8383b0d76b697b3f9b57ee7196f485b4db1baabf /features | |
parent | 29ec592f0e481080c3bb7679318c883fea15d458 (diff) | |
download | rt.equinox.framework-db53ed0dece0186f5ea1adad05151206f8f259ce.tar.gz rt.equinox.framework-db53ed0dece0186f5ea1adad05151206f8f259ce.tar.xz rt.equinox.framework-db53ed0dece0186f5ea1adad05151206f8f259ce.zip |
Bug 467991 - Enable GTK3 mode for eclipse on ppc64le platformI20150526-2010
- Modified GTK2 version check to match the ppc64le build platform(only
on ppc64le)
- Removed the code to force GTK2 execution eventhough GTK3 is available
- Modified the code for the case where SWT_GTK3 flag is defined and no
compatible gtk3 is available
- Updated the patch based on review comments
Change-Id: If66755fa938e3b57a464fa457756f97b1400a9ba
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Diffstat (limited to 'features')
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/eclipse.c | 7 | ||||
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c | 22 |
2 files changed, 22 insertions, 7 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c index c7663665e..444c89b88 100644 --- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c +++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c @@ -527,13 +527,6 @@ static int _run(int argc, _TCHAR* argv[], _TCHAR* vmArgs[]) #endif #endif -#ifdef LINUX -#ifdef __ppc64le__ - /* set the swt gtk3 flag to 0 so that we use only GTK2 on ppc64le platform */ - setenv("SWT_GTK3","0",1); -#endif -#endif - /* try to open the specified file in an already running eclipse */ /* on Mac we are only registering an event handler here, always do this */ #ifndef MACOSX 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 8abe5d615..a615316ec 100644 --- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c +++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c @@ -26,6 +26,11 @@ static _TCHAR* upgradeWarning2 = _T_ECLIPSE("\nor use an older version of Eclips static int minGtkMajorVersion = 2; static int minGtkMinorVersion = 18; static int minGtkMicroVersion = 0; +#ifdef __ppc64le__ +static int minGtk3MajorVersion = 3; +static int minGtk3MinorVersion = 10; +static int minGtk3MicroVersion = 9; +#endif /* tables to help initialize the function pointers */ /* functions from libgtk-x11-2.0 or libgtk-3.so.0*/ @@ -131,6 +136,23 @@ int loadGtk() { if (gdkCoreDeviceEvents == NULL) { setenv("GDK_CORE_DEVICE_EVENTS", "1", 0); } +#ifdef __ppc64le__ + 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)(minGtk3MajorVersion, minGtk3MinorVersion, minGtk3MicroVersion); + if (check != NULL) { + dlclose(gdkLib); + dlclose(gtkLib); + gdkLib = gtkLib = NULL; + setenv("SWT_GTK3","0",0); + } + } + } +#endif + } if (!gtkLib || !gdkLib) { //if GTK+ 2 gdkLib = dlopen(GDK_LIB, DLFLAGS); |