Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2016-07-12 17:15:20 +0000
committerAlexander Kurtakov2016-07-13 20:23:35 +0000
commitdde7b314167d13bbb357525231b0ffc20c4feb2e (patch)
treefa00c3f267feea9181a1492e0a0ce3b285bc99fc
parent814a0209eb942b533de379b718596f1512e4b23c (diff)
downloadeclipse.platform.swt-dde7b314167d13bbb357525231b0ffc20c4feb2e.tar.gz
eclipse.platform.swt-dde7b314167d13bbb357525231b0ffc20c4feb2e.tar.xz
eclipse.platform.swt-dde7b314167d13bbb357525231b0ffc20c4feb2e.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. Change-Id: I6940e49d797864bc6e341725d4a6e1e6f2d06305 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java13
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 c894731cfe..03c79036bf 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
@@ -12878,6 +12878,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 b686351946..33c8fcfa4e 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 bbe3647672..e9c162c244 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 7686bedad7..eb75ce3109 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
@@ -9542,6 +9542,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) {

Back to the top