diff options
author | Eric Williams | 2016-08-16 14:54:56 +0000 |
---|---|---|
committer | Eric Williams | 2016-08-16 15:47:02 +0000 |
commit | 54d81788a6efe1f9452ee795daa34c2b8d879b0a (patch) | |
tree | 9d2b9bb37c5991c82a218e7a7b1d9bd7fc9ff464 | |
parent | 287bc426fc256ead2f6c99adc8af7d784923ac10 (diff) | |
download | eclipse.platform.swt-54d81788a6efe1f9452ee795daa34c2b8d879b0a.tar.gz eclipse.platform.swt-54d81788a6efe1f9452ee795daa34c2b8d879b0a.tar.xz eclipse.platform.swt-54d81788a6efe1f9452ee795daa34c2b8d879b0a.zip |
Bug 497444 - [GTK3] Progress indicator not updating in the splash screen
of Eclipse
Instead of sending expose events and flushing better to give GTK the
ability to do its work by letting it run iteration in its own even loop.
Please note, this is a backport to 4.6 of the original fix.
Change-Id: I57845e6e1eee972c79ec761f70524c4c7c41c59e
Signed-off-by: Eric Williams <ericwill@redhat.com>
5 files changed, 23 insertions, 12 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 fb6e308430..1f3be9f0a1 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 @@ -12870,6 +12870,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1main_1do_1event) } #endif +#ifndef NO__1gtk_1main_1iteration_1do +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1main_1iteration_1do) + (JNIEnv *env, jclass that, jboolean arg0) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1main_1iteration_1do_FUNC); + gtk_main_iteration_do((gboolean)arg0); + OS_NATIVE_EXIT(env, that, _1gtk_1main_1iteration_1do_FUNC); +} +#endif + #ifndef NO__1gtk_1major_1version JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1major_1version) (JNIEnv *env, jclass that) 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 b7eb2fcb31..ca2a252e16 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 @@ -938,6 +938,7 @@ char * OS_nativeFunctionNames[] = { #endif "_1gtk_1main", "_1gtk_1main_1do_1event", + "_1gtk_1main_1iteration_1do", "_1gtk_1major_1version", "_1gtk_1menu_1bar_1new", "_1gtk_1menu_1item_1get_1submenu", 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 f36ea694cf..c549ca9557 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 @@ -948,6 +948,7 @@ typedef enum { #endif _1gtk_1main_FUNC, _1gtk_1main_1do_1event_FUNC, + _1gtk_1main_1iteration_1do_FUNC, _1gtk_1major_1version_FUNC, _1gtk_1menu_1bar_1new_FUNC, _1gtk_1menu_1item_1get_1submenu_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 34090a99b8..af49673a0b 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 @@ -9537,6 +9537,16 @@ public static final void gtk_main() { lock.unlock(); } } +/** @param blocking cast=(gboolean) */ +public static final native void _gtk_main_iteration_do(boolean blocking); +public static final void gtk_main_iteration_do(boolean blocking) { + lock.lock(); + try { + _gtk_main_iteration_do(blocking); + } finally { + lock.unlock(); + } +} /** @param event cast=(GdkEvent *) */ public static final native void _gtk_main_do_event(long /*int*/ event); public static final void gtk_main_do_event(long /*int*/ event) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java index cbdd8c77b1..33994d9217 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java @@ -301,18 +301,7 @@ void updateBar (int selection, int minimum, int maximum) { double fraction = minimum == maximum ? 1 : (double)(selection - minimum) / (maximum - minimum); OS.gtk_progress_bar_set_fraction (handle, fraction); - if (!OS.GTK3) { - /* - * Feature in GTK. The progress bar does - * not redraw right away when a value is - * changed. This is not strictly incorrect - * but unexpected. The fix is to force all - * outstanding redraws to be delivered. - */ - long /*int*/ window = paintWindow (); - OS.gdk_window_process_updates (window, false); - OS.gdk_flush (); - } + OS.gtk_main_iteration_do(false); } void gtk_orientable_set_orientation (long /*int*/ pbar, int orientation) { |