Skip to content

Commit 97a032b

Browse files
committed
[GTK] Fix Combo copy/paste tests
Gtk 4 no longer provides API for doing that but rather a built-in action to activate. This requires to spin the event loop to process it.
1 parent 1eb32bc commit 97a032b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,7 @@ public void paste () {
19691969
if (GTK.GTK4) {
19701970
long textHandle = GTK4.gtk_widget_get_first_child(entryHandle);
19711971
GTK4.gtk_widget_activate_action(textHandle, OS.action_paste_clipboard, null);
1972+
display.processEvents();
19721973
} else {
19731974
GTK3.gtk_editable_paste_clipboard (entryHandle);
19741975
}

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,6 +4543,13 @@ public boolean readAndDispatch () {
45434543
return isDisposed () || runAsyncMessages (false);
45444544
}
45454545

4546+
void processEvents() {
4547+
if (!isDisposed()) {
4548+
while (readAndDispatch()) {
4549+
}
4550+
}
4551+
}
4552+
45464553
static void register (Display display) {
45474554
synchronized (Device.class) {
45484555
for (int i=0; i<Displays.length; i++) {

0 commit comments

Comments
 (0)