diff options
| author | Eric Williams | 2015-11-23 15:37:11 +0000 |
|---|---|---|
| committer | Eric Williams | 2015-11-24 19:23:20 +0000 |
| commit | ba37193032191f6c121bbbe35024e212582acf06 (patch) | |
| tree | 7ccca8d1ae3e439454ea2d70884bf88359f4b2c2 | |
| parent | 7cf4cea788cf2d6d7b64d201f4b79da643d1de28 (diff) | |
| download | eclipse.platform.swt-ba37193032191f6c121bbbe35024e212582acf06.tar.gz eclipse.platform.swt-ba37193032191f6c121bbbe35024e212582acf06.tar.xz eclipse.platform.swt-ba37193032191f6c121bbbe35024e212582acf06.zip | |
Bug 481122: [GTK3.18+] some set/get Background/Foreground color methods
have no effect
With changes in GTK3.18 and onward, gtk_style_context_get_color()
behaves differently. In order to correctly fetch the color we must first
save the GtkStyleContext, set its state, fetch the color, and then
restore the GtkStyleContext. Failure to do this on GTK3.18+ leads to
failures in the getForegroundColor() method.
The convenience method styleContextGetColor() in Display takes care of
the process.
Tested on GTK 3.18, 3.16, 3.14, 3.8, and 2.24. All foreground color
related tests on GTK3 now pass. GTK2 behaviour remains unchanged.
Change-Id: I0ca431a43c3eab30bd4f1a0d5282c3ae276d031c
Signed-off-by: Eric Williams <ericwill@redhat.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index 6b68b6a5b6..ee9172e39d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -1664,7 +1664,7 @@ void drawMessage (long /*int*/ cr) { if (OS.GTK3) { long /*int*/ styleContext = OS.gtk_widget_get_style_context (handle); GdkRGBA rgba = new GdkRGBA (); - rgba = display.styleContextGetColor (context, OS.GTK_STATE_FLAG_INSENSITIVE, rgba); + rgba = display.styleContextGetColor (styleContext, OS.GTK_STATE_FLAG_INSENSITIVE, rgba); textColor.red = (short)(rgba.red * 0xFFFF); textColor.green = (short)(rgba.green * 0xFFFF); textColor.blue = (short)(rgba.blue * 0xFFFF); |
