From f09d0ca24bb23a1d955410c507719778f1f05304 Mon Sep 17 00:00:00 2001 From: Aleksandar Kurtakov Date: Tue, 13 May 2025 17:24:24 +0300 Subject: [PATCH] [GTK4] Implement Combo.paste It shouldn't call GTK 3 function (causes a crash right now) and same approach as cut/copy is used. --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 b2dbea8ee04..f82d16d6f84 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 @@ -1965,7 +1965,14 @@ long paintSurface () { */ public void paste () { checkWidget (); - if (entryHandle != 0) GTK3.gtk_editable_paste_clipboard (entryHandle); + if (entryHandle != 0) { + if (GTK.GTK4) { + long textHandle = GTK4.gtk_widget_get_first_child(entryHandle); + GTK4.gtk_widget_activate_action(textHandle, OS.action_paste_clipboard, null); + } else { + GTK3.gtk_editable_paste_clipboard (entryHandle); + } + } } @Override