Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2019-02-08 10:27:20 -0500
committerEric Williams2019-02-08 10:30:41 -0500
commit0be4b8fcc50e0d652b8f565cdf98e43e5de34cc3 (patch)
treef5a8888e435ffa060a31dd25557bda2e8cfeaa46
parentc90f23c0191a0615d00083530791a8d7738581a3 (diff)
downloadeclipse.platform.swt-0be4b8fcc50e0d652b8f565cdf98e43e5de34cc3.tar.gz
eclipse.platform.swt-0be4b8fcc50e0d652b8f565cdf98e43e5de34cc3.tar.xz
eclipse.platform.swt-0be4b8fcc50e0d652b8f565cdf98e43e5de34cc3.zip
Bug 515849: Enable Device.DEBUG via SWT_DEBUG=1 env variable
Enable Device.DEBUG via SWT_DEBUG=1. Change-Id: Ie3e4064484cd8546072b348380e05830cb31b6c5 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java1
2 files changed, 14 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 16c7c5ead4..aa03c447f3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -691,6 +691,11 @@ public class OS extends C {
public static final boolean SWT_MENU_LOCATION_DEBUGGING;
/*
+ * Enable the DEBUG flag via environment variable. See bug 515849.
+ */
+ public static final boolean SWT_DEBUG;
+
+ /*
* Check for the GTK_THEME environment variable. If set, parse
* it to get the theme name and check if a dark variant is specified.
* We can make use of this information when loading SWT system colors.
@@ -741,6 +746,14 @@ public class OS extends C {
}
SWT_MENU_LOCATION_DEBUGGING = menuLocationDebuggingEnabled;
+ String debugProperty = "SWT_DEBUG";
+ String debugCheck = getEnvironmentalVariable(debugProperty);
+ boolean swtDebuggingEnabled = false;
+ if (debugCheck != null && debugCheck.equals("1")) {
+ swtDebuggingEnabled = true;
+ }
+ SWT_DEBUG = swtDebuggingEnabled;
+
String gtkThemeProperty = "GTK_THEME";
String gtkThemeCheck = getEnvironmentalVariable(gtkThemeProperty);
boolean gtkThemeSet = false;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 6c2730e000..d073f2cf0a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -1046,6 +1046,7 @@ void createDisplay (DeviceData data) {
if (OS.isX11()) {
xDisplay = GTK.GTK4 ? 0 : GDK.gdk_x11_get_default_xdisplay();
}
+ if (OS.SWT_DEBUG) Device.DEBUG = true;
long /*int*/ ptr = GTK.gtk_check_version (GTK3_MAJOR, GTK3_MINOR, GTK3_MICRO);
if (ptr != 0) {
int length = C.strlen (ptr);

Back to the top