diff --git a/eclipse-bug-478962.patch b/eclipse-bug-478962.patch new file mode 100644 index 0000000..c248c5c --- /dev/null +++ b/eclipse-bug-478962.patch @@ -0,0 +1,205 @@ +From 87d512619f0b0b05332e4c83f651f29bfa50c5e9 Mon Sep 17 00:00:00 2001 +From: Snjezana Peco +Date: Tue, 24 Nov 2015 13:46:51 +0100 +Subject: Bug 478962 - [GTK3] Eclipse Mars SR1 consumes 60% CPU while idling + +The +https://git.gnome.org/browse/gtk+/commit/?id=fe51ac273c8045279a222c22a52d297d5ede4169 +commit changes the state of a node instead of copying the style info. +When getting some properties (color, background color, border, padding), +SWT changes the state of the node 0 (OS.GTK_STATE_FLAG_NORMAL) which +sometimes causes a widget to continously repaint. +For example: +SWT uses the following method to get the background color: + +OS.gtk_style_context_get_background_color (context, +OS.GTK_STATE_FLAG_NORMAL, rgba); + +This method changes the state of a node to 0 (OS.GTK_STATE_FLAG_NORMAL). +CTabFolder calls the method from inside the paint listener which causes an +infinite painting loop. + +This commit fixes the issue by using the widget's current style state +instead of OS.GTK_STATE_FLAG_NORMAL. + +Change-Id: I4dd27e3f6c5895a115fd76788ca2b2322aad6c4d +Signed-off-by: Snjezana Peco +--- + bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c | 8 ++++---- + .../gtk/org/eclipse/swt/internal/gtk/OS.java | 4 ++-- + .../gtk/org/eclipse/swt/widgets/Control.java | 17 +++++++++++------ + .../gtk/org/eclipse/swt/widgets/DateTime.java | 8 +++++--- + .../gtk/org/eclipse/swt/widgets/Spinner.java | 5 +++-- + .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java | 3 ++- + 6 files changed, 27 insertions(+), 18 deletions(-) + +diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +index c0dff7f..52ade78 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c ++++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +@@ -18341,18 +18341,18 @@ fail: + #endif + + #ifndef NO__1gtk_1widget_1get_1state_1flags +-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1state_1flags) ++JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1widget_1get_1state_1flags) + (JNIEnv *env, jclass that, jintLong arg0) + { +- jintLong rc = 0; ++ jint rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1state_1flags_FUNC); + /* +- rc = (jintLong)gtk_widget_get_state_flags((GtkWidget *)arg0); ++ rc = (jint)gtk_widget_get_state_flags((GtkWidget *)arg0); + */ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_state_flags) + if (fp) { +- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkWidget *))fp)((GtkWidget *)arg0); ++ rc = (jint)((jintLong (CALLING_CONVENTION*)(GtkWidget *))fp)((GtkWidget *)arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1state_1flags_FUNC); +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 0ee6dda..a7fb6fe 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 +@@ -11855,8 +11855,8 @@ public static final void gtk_style_context_restore(long /*int*/ context) { + /** @method flags=dynamic + * @param self cast=(GtkWidget *) + * */ +-public static final native long /*int*/ _gtk_widget_get_state_flags(long /*int*/ self); +-public static final long /*int*/ gtk_widget_get_state_flags(long /*int*/ self) { ++public static final native int _gtk_widget_get_state_flags(long /*int*/ self); ++public static final int gtk_widget_get_state_flags(long /*int*/ self) { + lock.lock(); + try { + return _gtk_widget_get_state_flags(self); +diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +index 7061084..ecf2da0 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java ++++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +@@ -2610,8 +2610,9 @@ public Image getBackgroundImage () { + GdkColor getContextBackground () { + long /*int*/ fontHandle = fontHandle (); + long /*int*/ context = OS.gtk_widget_get_style_context (fontHandle); ++ int styleState = OS.gtk_widget_get_state_flags(handle); + GdkRGBA rgba = new GdkRGBA (); +- OS.gtk_style_context_get_background_color (context, OS.GTK_STATE_FLAG_NORMAL, rgba); ++ OS.gtk_style_context_get_background_color (context, styleState, rgba); + if (rgba.alpha == 0) { + return display.COLOR_WIDGET_BACKGROUND; + } +@@ -2625,8 +2626,9 @@ GdkColor getContextBackground () { + GdkColor getContextColor () { + long /*int*/ fontHandle = fontHandle (); + long /*int*/ context = OS.gtk_widget_get_style_context (fontHandle); ++ int styleState = OS.gtk_widget_get_state_flags(handle); + GdkRGBA rgba = new GdkRGBA (); +- rgba = display.styleContextGetColor (context, OS.GTK_STATE_FLAG_NORMAL, rgba); ++ rgba = display.styleContextGetColor (context, styleState, rgba); + GdkColor color = new GdkColor (); + color.red = (short)(rgba.red * 0xFFFF); + color.green = (short)(rgba.green * 0xFFFF); +@@ -2761,7 +2763,8 @@ long /*int*/ getFontDescription () { + long /*int*/ fontHandle = fontHandle (); + if (OS.GTK3) { + long /*int*/ context = OS.gtk_widget_get_style_context (fontHandle); +- return OS.gtk_style_context_get_font(context, OS.GTK_STATE_FLAG_NORMAL); ++ int styleState = OS.gtk_widget_get_state_flags(fontHandle); ++ return OS.gtk_style_context_get_font(context, styleState); + } + OS.gtk_widget_realize (fontHandle); + return OS.gtk_style_get_font_desc (OS.gtk_widget_get_style (fontHandle)); +@@ -3021,12 +3024,13 @@ Point getThickness (long /*int*/ widget) { + int xthickness = 0, ythickness = 0; + GtkBorder tmp = new GtkBorder(); + long /*int*/ context = OS.gtk_widget_get_style_context (widget); ++ int styleState = OS.gtk_widget_get_state_flags(widget); + OS.gtk_style_context_save (context); + OS.gtk_style_context_add_class (context, OS.GTK_STYLE_CLASS_FRAME); +- OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ OS.gtk_style_context_get_padding (context, styleState, tmp); + xthickness += tmp.left; + ythickness += tmp.top; +- OS.gtk_style_context_get_border (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ OS.gtk_style_context_get_border (context, styleState, tmp); + xthickness += tmp.left; + ythickness += tmp.top; + OS.gtk_style_context_restore (context); +@@ -5595,7 +5599,8 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ us + if (OS.GTK3 && !draw && (state & CANVAS) != 0) { + GdkRGBA rgba = new GdkRGBA(); + long /*int*/ context = OS.gtk_widget_get_style_context (handle); +- OS.gtk_style_context_get_background_color (context, OS.GTK_STATE_FLAG_NORMAL, rgba); ++ int styleState = OS.gtk_widget_get_state_flags(handle); ++ OS.gtk_style_context_get_background_color (context, styleState, rgba); + draw = rgba.alpha == 0; + } + if (draw) { +diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java +index 12bca54..81780bd 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java ++++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java +@@ -296,13 +296,14 @@ public Rectangle computeTrim (int x, int y, int width, int height) { + if (OS.GTK3) { + GtkBorder tmp = new GtkBorder (); + long /*int*/ context = OS.gtk_widget_get_style_context (textEntryHandle); +- OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ int styleState = OS.gtk_widget_get_state_flags(textEntryHandle); ++ OS.gtk_style_context_get_padding (context, styleState, tmp); + trim.x -= tmp.left; + trim.y -= tmp.top; + trim.width += tmp.left + tmp.right; + trim.height += tmp.top + tmp.bottom; + if ((style & SWT.BORDER) != 0) { +- OS.gtk_style_context_get_border (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ OS.gtk_style_context_get_border (context, styleState, tmp); + trim.x -= tmp.left; + trim.y -= tmp.top; + trim.width += tmp.left + tmp.right; +@@ -1738,7 +1739,8 @@ GtkBorder getGtkBorderPadding () { + //In Gtk3, acquire border. + GtkBorder gtkBorderPadding = new GtkBorder (); + long /*int*/ context = OS.gtk_widget_get_style_context (textEntryHandle); +- OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, gtkBorderPadding); ++ int styleState = OS.gtk_widget_get_state_flags(textEntryHandle); ++ OS.gtk_style_context_get_padding (context, styleState, gtkBorderPadding); + return gtkBorderPadding; + } else { + //in GTK2 hard code the padding +diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java +index 7550122..3bbb886 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java ++++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java +@@ -255,9 +255,10 @@ public Rectangle computeTrim (int x, int y, int width, int height) { + if (OS.GTK3) { + GtkBorder tmp = new GtkBorder(); + long /*int*/ context = OS.gtk_widget_get_style_context (handle); +- OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ int styleState = OS.gtk_widget_get_state_flags(handle); ++ OS.gtk_style_context_get_padding (context, styleState, tmp); + if ((style & SWT.BORDER) != 0) { +- OS.gtk_style_context_get_border (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ OS.gtk_style_context_get_border (context, styleState, tmp); + trim.x -= tmp.left; + trim.y -= tmp.top; + trim.width += tmp.left + tmp.right; +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 ee9172e..8d5d0ba 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 +@@ -591,7 +591,8 @@ public Rectangle computeTrim (int x, int y, int width, int height) { + if (OS.GTK3) { + GtkBorder tmp = new GtkBorder(); + long /*int*/ context = OS.gtk_widget_get_style_context (handle); +- OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, tmp); ++ int styleState = OS.gtk_widget_get_state_flags(handle); ++ OS.gtk_style_context_get_padding (context, styleState, tmp); + trim.x -= tmp.left; + trim.y -= tmp.top; + trim.width += tmp.left + tmp.right; +-- +cgit v0.11.2-4-g4a35 + + diff --git a/eclipse-bug-479998.patch b/eclipse-bug-479998.patch new file mode 100644 index 0000000..7f13a20 --- /dev/null +++ b/eclipse-bug-479998.patch @@ -0,0 +1,296 @@ +From daefb444e2757b0fda729cafbeea7c19efa979a3 Mon Sep 17 00:00:00 2001 +From: Eric Williams +Date: Thu, 26 Nov 2015 08:46:27 -0500 +Subject: Bug 479998: [GTK3] Form/wizard Composites have incorrect background + colors + +As of GTK3.16 gtk_widget_override_background_color() is deprecated. +Unfortunately in GTK3.18 it has started to break the background colors +of SwtFixed containers. This is most notably visible in the workspace +selection and commit dialogs, where some background containers had the +default gray background color when they should have been white. + +This fix overrides the draw signal in Composite, which allows for CSS +rendering of the background color using gtk_render_background(), which +is the recommended fix as per the GTK team's changes. This ensures that +every composite is drawn with the correct background color if it is set. + +The only additional side effect is that ToolBar background colors need +to be set with CSS also, since some SwtFixed containers that were +previously being overridden by ToolBar background colors now are +correctly displaying their own background. This means that ToolBars need +to be rendered with CSS as well. This can be accomplished very easily by +overriding the setBackgroundColor() method in ToolBar.java. + +This change will only affect SWT using GTK3.16 and upward. Anything +below 3.16 still uses the old function (which works reliably on those +versions). + +Change-Id: If9d1037fd24b9739e0c30ff794eb6fed0247d56f +Signed-off-by: Eric Williams +--- + .../Eclipse SWT PI/gtk/library/os.c | 26 +++++++++++++- + .../Eclipse SWT PI/gtk/library/os.h | 1 + + .../Eclipse SWT PI/gtk/library/os_custom.h | 1 + + .../Eclipse SWT PI/gtk/library/os_stats.c | 1 + + .../Eclipse SWT PI/gtk/library/os_stats.h | 1 + + .../gtk/org/eclipse/swt/internal/gtk/OS.java | 13 +++++++ + .../gtk/org/eclipse/swt/widgets/Composite.java | 40 ++++++++++++++++++++++ + .../gtk/org/eclipse/swt/widgets/Control.java | 29 ++++++++++++---- + .../gtk/org/eclipse/swt/widgets/ToolBar.java | 10 ++++++ + 9 files changed, 115 insertions(+), 7 deletions(-) + +diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +index 52ade78..2d47a1c 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c ++++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +@@ -7181,6 +7181,30 @@ fail: + } + #endif + ++#ifndef NO__1gdk_1rgba_1to_1string ++JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1rgba_1to_1string) ++ (JNIEnv *env, jclass that, jobject arg0) ++{ ++ GdkRGBA _arg0, *lparg0=NULL; ++ jintLong rc = 0; ++ OS_NATIVE_ENTER(env, that, _1gdk_1rgba_1to_1string_FUNC); ++ if (arg0) if ((lparg0 = getGdkRGBAFields(env, arg0, &_arg0)) == NULL) goto fail; ++/* ++ rc = (jintLong)gdk_rgba_to_string((GdkRGBA *)lparg0); ++*/ ++ { ++ OS_LOAD_FUNCTION(fp, gdk_rgba_to_string) ++ if (fp) { ++ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GdkRGBA *))fp)((GdkRGBA *)lparg0); ++ } ++ } ++fail: ++ if (arg0 && lparg0) setGdkRGBAFields(env, arg0, lparg0); ++ OS_NATIVE_EXIT(env, that, _1gdk_1rgba_1to_1string_FUNC); ++ return rc; ++} ++#endif ++ + #ifndef NO__1gdk_1screen_1get_1default + JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1screen_1get_1default) + (JNIEnv *env, jclass that) +@@ -18352,7 +18376,7 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1widget_1get_1state_1flags) + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_state_flags) + if (fp) { +- rc = (jint)((jintLong (CALLING_CONVENTION*)(GtkWidget *))fp)((GtkWidget *)arg0); ++ rc = (jint)((jint (CALLING_CONVENTION*)(GtkWidget *))fp)((GtkWidget *)arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1state_1flags_FUNC); +diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h +index 2ccdca2..90084ea 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h ++++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h +@@ -184,6 +184,7 @@ + #define NO__1gtk_1style_1context_1set_1state + #define NO__1gtk_1color_1chooser_1get_1rgba + #define NO__1gtk_1color_1chooser_1set_1rgba ++#define NO__1gdk_1rgba_1to_1string + + #define NO__1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2I + #define NO__1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2J +diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +index a293df9..6cd4c80 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h ++++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +@@ -307,6 +307,7 @@ + #define gdk_pointer_ungrab_LIB LIB_GDK + #define gdk_region_polygon_LIB LIB_GDK + #define gdk_region_get_rectangles_LIB LIB_GDK ++#define gdk_rgba_to_string_LIB LIB_GDK + #define gdk_screen_get_default_LIB LIB_GDK + #define gdk_screen_get_monitor_at_point_LIB LIB_GDK + #define gdk_screen_get_monitor_at_window_LIB LIB_GDK +diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +index bd9d7b5..ad9f01d 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c ++++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +@@ -554,6 +554,7 @@ char * OS_nativeFunctionNames[] = { + "_1gdk_1region_1subtract", + "_1gdk_1region_1union", + "_1gdk_1region_1union_1with_1rect", ++ "_1gdk_1rgba_1to_1string", + "_1gdk_1screen_1get_1default", + "_1gdk_1screen_1get_1monitor_1at_1point", + "_1gdk_1screen_1get_1monitor_1at_1window", +diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +index 016b472..cb21fb3 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h ++++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +@@ -564,6 +564,7 @@ typedef enum { + _1gdk_1region_1subtract_FUNC, + _1gdk_1region_1union_FUNC, + _1gdk_1region_1union_1with_1rect_FUNC, ++ _1gdk_1rgba_1to_1string_FUNC, + _1gdk_1screen_1get_1default_FUNC, + _1gdk_1screen_1get_1monitor_1at_1point_FUNC, + _1gdk_1screen_1get_1monitor_1at_1window_FUNC, +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 a7fb6fe..a1795dd 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 +@@ -5492,6 +5492,19 @@ public static final void gdk_region_union_with_rect(long /*int*/ region, GdkRect + lock.unlock(); + } + } ++/** ++ * @method flags=dynamic ++ * @param rgba cast=(GdkRGBA *) ++ */ ++public static final native long /*int*/ _gdk_rgba_to_string(GdkRGBA rgba); ++public static final long /*int*/ gdk_rgba_to_string(GdkRGBA rgba) { ++ lock.lock(); ++ try { ++ return _gdk_rgba_to_string(rgba); ++ } finally { ++ lock.unlock(); ++ } ++} + /** @method flags=dynamic */ + public static final native long /*int*/ _gdk_screen_get_default(); + public static final long /*int*/ gdk_screen_get_default() { +diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +index 4c4b557..e0f4782 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java ++++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +@@ -64,6 +64,7 @@ public class Composite extends Scrollable { + Layout layout; + Control[] tabList; + int layoutCount, backgroundMode; ++ GdkRGBA background; + + static final String NO_INPUT_METHOD = "org.eclipse.swt.internal.gtk.noInputMethod"; //$NON-NLS-1$ + +@@ -352,6 +353,16 @@ void createHandle (int index, boolean fixed, boolean scrolled) { + } + + @Override ++long /*int*/ gtk_draw (long /*int*/ widget, long /*int*/ cairo) { ++ if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { ++ Rectangle area = getClientArea(); ++ long /*int*/ context = OS.gtk_widget_get_style_context(widget); ++ OS.gtk_render_background(context, cairo, area.x, area.y, area.width, area.height); ++ } ++ return super.gtk_draw(widget, cairo); ++} ++ ++@Override + void deregister () { + super.deregister (); + if (socketHandle != 0) display.removeWidget (socketHandle); +@@ -650,6 +661,23 @@ public Rectangle getClientArea () { + return super.getClientArea(); + } + ++@Override ++GdkColor getContextBackground () { ++ if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { ++ if (background != null) { ++ GdkColor color = new GdkColor (); ++ color.red = (short)(background.red * 0xFFFF); ++ color.green = (short)(background.green * 0xFFFF); ++ color.blue = (short)(background.blue * 0xFFFF); ++ return color; ++ } else { ++ return display.COLOR_WIDGET_BACKGROUND; ++ } ++ } else { ++ return super.getContextBackground(); ++ } ++} ++ + /** + * Returns layout which is associated with the receiver, or + * null if one has not been set. +@@ -1438,6 +1466,18 @@ public void setBackgroundMode (int mode) { + } + + @Override ++void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) { ++ if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { ++ background = rgba; ++ String color = gtk_rgba_to_css_string(background); ++ String css = "SwtFixed {background-color: " + color + "}"; ++ gtk_css_provider_load_from_css(context, css); ++ } else { ++ super.setBackgroundColor(context, handle, rgba); ++ } ++} ++ ++@Override + int setBounds (int x, int y, int width, int height, boolean move, boolean resize) { + int result = super.setBounds (x, y, width, height, move, resize); + if ((result & RESIZED) != 0 && layout != null) { +diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +index ecf2da0..f297659 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java ++++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +@@ -4096,13 +4096,30 @@ void gtk_css_provider_load_from_css (long /*int*/ context, String css) { + + String gtk_rgba_to_css_string (GdkRGBA rgba) { + /* +- * In GdkRGBA, values are a double between 0-1.
+- * In CSS, values are typically integers between 0-255.
+- * I.e, note, there is a slight loss of precision. +- * Thus setting/getting color *might* return slight differences. ++ * In GdkRGBA, values are a double between 0-1. ++ * In CSS, values are integers between 0-255 for r, g, and b. ++ * Alpha is still a double between 0-1. ++ * The final CSS format is: rgba(int, int, int, double) ++ * Due to this, there is a slight loss of precision. ++ * Setting/getting with CSS *might* yield slight differences. + */ +- String color = "rgba(" + (int)(rgba.red * 255) + "," + (int)(rgba.green * 255) + "," + (int)(rgba.blue * 255) + "," + (int)(rgba.alpha * 255) + ")"; +- return color; ++ GdkRGBA toConvert; ++ if (rgba != null) { ++ toConvert = rgba; ++ } else { ++ // If we have a null RGBA, set it to the default COLOR_WIDGET_BACKGROUND. ++ GdkColor defaultGdkColor = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND).handle; ++ toConvert = new GdkRGBA (); ++ toConvert.alpha = 1.0; ++ toConvert.red = (defaultGdkColor.red & 0xFFFF) / (float)0xFFFF; ++ toConvert.green = (defaultGdkColor.green & 0xFFFF) / (float)0xFFFF; ++ toConvert.blue = (defaultGdkColor.blue & 0xFFFF) / (float)0xFFFF; ++ } ++ long /*int*/ str = OS.gdk_rgba_to_string (toConvert); ++ int length = OS.strlen (str); ++ byte [] buffer = new byte [length]; ++ OS.memmove (buffer, str, length); ++ return new String (Converter.mbcsToWcs (null, buffer)); + } + + void setBackgroundColor (long /*int*/ handle, GdkColor color) { +diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java +index 8f6d149..d69f1d6 100644 +--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java ++++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java +@@ -600,6 +600,16 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize + } + + @Override ++void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) { ++ if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { ++ String css = "GtkToolbar {background-color: " + gtk_rgba_to_css_string(rgba) + "}"; ++ gtk_css_provider_load_from_css(context, css); ++ } else { ++ super.setBackgroundColor(context, handle, rgba); ++ } ++} ++ ++@Override + void setFontDescription (long /*int*/ font) { + super.setFontDescription (font); + ToolItem [] items = getItems (); +-- +cgit v0.11.2-4-g4a35 + + diff --git a/eclipse.spec b/eclipse.spec index f1ee74a..c293d63 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -49,7 +49,7 @@ Epoch: 1 Summary: An open, extensible IDE Name: eclipse Version: %{eclipse_version} -Release: 5%{?dist} +Release: 6%{?dist} License: EPL URL: http://www.eclipse.org/ @@ -139,9 +139,12 @@ Patch26: eclipse-editor-scrolling-fix.patch Patch27: %{pkg_name}-bug-480986.patch # Fix visual glitches when on recent GTK3 +# These are backported from upstream master Patch28: eclipse-bug-466314.patch Patch29: eclipse-bug-481122.patch Patch30: eclipse-bug-466500.patch +Patch31: eclipse-bug-478962.patch +Patch32: eclipse-bug-479998.patch BuildRequires: rsync BuildRequires: make, gcc @@ -201,7 +204,7 @@ BuildRequires: atinject-tck >= 1-18 BuildRequires: tycho >= 0.23.0 BuildRequires: tycho-extras >= 0.23.0 BuildRequires: cbi-plugins -BuildRequires: eclipse-ecf-core >= 3.11.0-1 +BuildRequires: eclipse-ecf-core >= 3.12.0-1 BuildRequires: eclipse-emf-core >= 1:2.11.0-1 BuildRequires: eclipse-license BuildRequires: glassfish-jsp-api >= 2.2.1-4 @@ -286,7 +289,7 @@ Requires: sac >= 1.3-12 Requires: batik-css >= 1.8-0.17 Requires: xml-commons-apis >= 1.4.01-12 Requires: atinject >= 1-18 -Requires: eclipse-ecf-core >= 3.11.0-1 +Requires: eclipse-ecf-core >= 3.12.0-1 Requires: eclipse-emf-core >= 1:2.11.0-1 Requires: glassfish-jsp-api >= 2.2.1-4 Requires: glassfish-jsp >= 2.2.5 @@ -395,6 +398,8 @@ popd pushd eclipse.platform.swt %patch28 -p1 %patch29 -p1 +%patch31 -p1 +%patch32 -p1 popd %patch30 -p1 @@ -1133,6 +1138,12 @@ fi %{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_* %changelog +* Sat Dec 05 2015 Mat Booth - 1:4.5.1-6 +- Fix issues with background colour in some dialogs +- ebz#478962, ebz#479998 +- Rebuild for new eclipse-ecf +- Preserve jars containing runtime stubs used in tests + * Fri Nov 27 2015 Mat Booth - 1:4.5.1-5 - Fix some visual glitches when on recent versions of GTK - ebz#466314, ebz#481122, ebz#466500 diff --git a/get-eclipse.sh b/get-eclipse.sh index be9bd9c..0acb205 100755 --- a/get-eclipse.sh +++ b/get-eclipse.sh @@ -20,7 +20,7 @@ rm -rf bootstrap devutils streams scripts find . -type d -name ".git" | xargs rm -rf # Delete pre-built binary artifacts except some test data that cannot be generated -find . ! -path "*/JCL/*" \ +find . ! -path "*/JCL/*" ! -name "rtstubs*.jar" \ -type f -name *.jar -delete find . -type f -name *.class -delete find . -type f -name *.so -delete diff --git a/sources b/sources index c91cf9e..33e6c51 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -8500e4cef00ed0feee3d1c908e3b954c R4_platform-aggregator-R4_5_1.tar.xz +e5d41fe15276fc027f0c5877be0abfbd R4_platform-aggregator-R4_5_1.tar.xz 2858c18b10628c8c76be18ff60351de0 org.eclipse.linuxtools.eclipse-build-f53a7bd2aedc58f1226833639b07e6dc7faf0470.tar.xz