Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2014-05-13 06:14:05 +0000
committerArun Thondapu2014-05-20 14:47:46 +0000
commit06e3fb2d6c734a0570c1af2694b69ebe27fa2a0f (patch)
treeeb46356913bfabc11911c27a659c6d9be3c68391 /features
parent11bba863341af0ce5dff30559bedecc972e2be01 (diff)
downloadrt.equinox.framework-06e3fb2d6c734a0570c1af2694b69ebe27fa2a0f.tar.gz
rt.equinox.framework-06e3fb2d6c734a0570c1af2694b69ebe27fa2a0f.tar.xz
rt.equinox.framework-06e3fb2d6c734a0570c1af2694b69ebe27fa2a0f.zip
Bug 434619 - Switching to GTK+ 2/3 should be easier for products I20140520-2000
Change-Id: Ic36d878f36cd30de564920b0ac2ecd295416d33b 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.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
index ce48cdc6d..90020dc5f 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -251,6 +251,7 @@ home directory.");
#define XXPERMGEN _T_ECLIPSE("-XX:MaxPermSize=")
#define ACTION_OPENFILE _T_ECLIPSE("openFile")
+#define GTK_VERSION _T_ECLIPSE("--launcher.GTK_version")
/* constants for ee options file */
#define EE_EXECUTABLE _T_ECLIPSE("-Dee.executable=")
@@ -279,6 +280,7 @@ static _TCHAR** filePath = NULL; /* list of files to open */
static _TCHAR* timeoutString = NULL; /* timeout value for opening a file */
static _TCHAR* defaultAction = NULL; /* default action for non '-' command line arguments */
static _TCHAR* iniFile = NULL; /* the launcher.ini file set if --launcher.ini was specified */
+static _TCHAR* gtkVersionString = NULL; /* GTK+ version specified by --launcher.GTK_version */
/* variables for ee options */
static _TCHAR* eeExecutable = NULL;
@@ -327,7 +329,8 @@ static Option options[] = {
{ OPENFILE, &filePath, ADJUST_PATH | VALUE_IS_LIST, -1 },
{ TIMEOUT, &timeoutString, 0, 2 },
{ DEFAULTACTION,&defaultAction, 0, 2 },
- { WS, &wsArg, 0, 2 } };
+ { WS, &wsArg, 0, 2 },
+ { GTK_VERSION, &gtkVersionString, 0, 2 } };
static int optionsSize = (sizeof(options) / sizeof(options[0]));
static Option eeOptions[] = {
@@ -482,9 +485,20 @@ static int _run(int argc, _TCHAR* argv[], _TCHAR* vmArgs[])
if (defaultAction != NULL) {
processDefaultAction(initialArgc, initialArgv);
}
-
- /* try to open the specified file in an already running eclipse */
- /* on Mac we are only registering an event handler here, always do this */
+
+ if (gtkVersionString != NULL) {
+ int gtkVersion;
+ _stscanf(gtkVersionString, _T_ECLIPSE("%d"), &gtkVersion);
+
+ if (gtkVersion == 2) {
+ setenv("SWT_GTK3","0",1);
+ } else {
+ setenv("SWT_GTK3","1",1);
+ }
+ }
+
+ /* 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
if (filePath != NULL && filePath[0] != NULL)
#endif

Back to the top