From 29c913b5d071149d7f0eb2f98ba2087136998c6e Mon Sep 17 00:00:00 2001 From: raghucssit Date: Thu, 11 Sep 2025 11:41:59 +0200 Subject: [PATCH] Spin event loop to process pending UI updates before checking the pasted content on the Text. As content copy/paste works well manually junit fails because junit checks the text content well before it is updated by GTK. So it is a timing delay. Processing all the pending events make sure text is updated(Either by introducing some delay in junit or really processing any pending UI updates). see https://github.com/eclipse-platform/eclipse.platform.swt/issues/2491 --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 6 ------ .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java | 8 ++++++-- .../tests/junit/Test_org_eclipse_swt_widgets_Text.java | 8 ++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index c36471d39a5..b75a838fd32 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -494,12 +494,6 @@ Point computeNativeSize (long h, int wHint, int hHint, boolean changed) { *

* The current selection is copied to the clipboard. *

- *

- * Note: Copy data to the Clipboard may be asynchronous. This - * means that the new clipboard content may not be immediately available right - * after calling this method. To ensure the update is visible, use - * {@link Display#asyncExec(Runnable)} before accessing the clipboard data. - *

* @exception SWTException