Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2016-09-20 07:32:24 +0000
committerAlexander Kurtakov2016-09-20 07:32:24 +0000
commit9460f86f13172520d8cbfaeb20aeecca8d829f38 (patch)
treeec4739923633e9347aca5c28730e97dbc8187485
parent1442b65a15fa6b4d877df34d32606cf8e0c5a74a (diff)
downloadeclipse.platform.swt-9460f86f13172520d8cbfaeb20aeecca8d829f38.tar.gz
eclipse.platform.swt-9460f86f13172520d8cbfaeb20aeecca8d829f38.tar.xz
eclipse.platform.swt-9460f86f13172520d8cbfaeb20aeecca8d829f38.zip
Bug 501665 - Add a property for the current GTK theme being used
Set the property in Display.createDisplay as all gtk functions should be called after gtk_init_check is called. This would fix the error "GLib-GObject-CRITICAL **: g_object_get: assertion 'G_IS_OBJECT (object)' failed" with the previous commit. Change-Id: Ia47ed1256c1709d7c71fca10a1436bb6e53f41a5 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java2
2 files changed, 2 insertions, 1 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 b5ae5cf271..fd25dfba3d 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
@@ -749,7 +749,6 @@ public class OS extends C {
System.setProperty("org.eclipse.swt.internal.gtk.version",
(GTK_VERSION >>> 16) + "." + (GTK_VERSION >>> 8 & 0xFF) + "." + (GTK_VERSION & 0xFF));
- System.setProperty("org.eclipse.swt.internal.gtk.theme", getThemeName());
}
protected static byte [] ascii (String name) {
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 2888cab138..601373b3d7 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
@@ -950,6 +950,8 @@ void createDisplay (DeviceData data) {
if (!OS.gtk_init_check (new long /*int*/ [] {0}, null)) {
SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]"); //$NON-NLS-1$
}
+ //set GTK+ Theme name as property for introspection purposes
+ System.setProperty("org.eclipse.swt.internal.gtk.theme", OS.getThemeName());
if (OS.isX11()) xDisplay = OS.gdk_x11_get_default_xdisplay();
int major = OS.gtk_major_version ();
long /*int*/ ptr;

Back to the top