Skip to content

Commit 1b7b9bb

Browse files
committed
[GTK4] Implement Combo.paste
It shouldn't call GTK 3 function (causes a crash right now) and same approach as cut/copy is used.
1 parent a13a22d commit 1b7b9bb

File tree

1 file changed

+8
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,14 @@ long paintSurface () {
19651965
*/
19661966
public void paste () {
19671967
checkWidget ();
1968-
if (entryHandle != 0) GTK3.gtk_editable_paste_clipboard (entryHandle);
1968+
if (entryHandle != 0) {
1969+
if (GTK.GTK4) {
1970+
long textHandle = GTK4.gtk_widget_get_first_child(entryHandle);
1971+
GTK4.gtk_widget_activate_action(textHandle, OS.action_paste_clipboard, null);
1972+
} else {
1973+
GTK3.gtk_editable_paste_clipboard (entryHandle);
1974+
}
1975+
}
19691976
}
19701977

19711978
@Override

0 commit comments

Comments
 (0)