From c68ffb23b7a9ac8df021257ebf51756475cdb4ae Mon Sep 17 00:00:00 2001 From: Aleksandar Kurtakov Date: Thu, 8 May 2025 14:23:35 +0300 Subject: [PATCH] [GTK] Fix Combo.getSelection on GTK 4 Fixes " UnsatisfiedLink 'long org.eclipse.swt.internal.gtk3.GTK3.gtk_entry_get_text(long)'" problem at runtime. --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 2 +- 1 file changed, 1 insertion(+), 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 c03ef9f3afa..b2dbea8ee04 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 @@ -1302,7 +1302,7 @@ public Point getSelection () { int [] end = new int [1]; if (entryHandle != 0) { GTK.gtk_editable_get_selection_bounds (entryHandle, start, end); - long ptr = GTK3.gtk_entry_get_text (entryHandle); + long ptr = GTK.GTK4 ? GTK4.gtk_entry_buffer_get_text(GTK4.gtk_entry_get_buffer(entryHandle)): GTK3.gtk_entry_get_text (entryHandle); start[0] = (int)OS.g_utf8_offset_to_utf16_offset (ptr, start[0]); end[0] = (int)OS.g_utf8_offset_to_utf16_offset (ptr, end[0]); }