fix usage of wrong widget in ui_textarea_focus (GTK)

Tue, 09 Jun 2026 18:47:19 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 09 Jun 2026 18:47:19 +0200
changeset 1186
b114038a48da
parent 1185
32f10747902b
child 1187
7b5ee7367b32

fix usage of wrong widget in ui_textarea_focus (GTK)

ui/gtk/text.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/text.c	Tue Jun 09 17:43:36 2026 +0200
+++ b/ui/gtk/text.c	Tue Jun 09 18:47:19 2026 +0200
@@ -247,7 +247,12 @@
 }
 
 void ui_textarea_focus(UIWIDGET textarea) {
-    gtk_widget_grab_focus(textarea);
+    GtkWidget *widget = ui_textarea_gettextwidget(textarea);
+    if(!widget) {
+        fprintf(stderr, "Error: ui_textarea_focus: widget is not a textarea\n");
+        return;
+    }
+    gtk_widget_grab_focus(widget);
 }
 
 void ui_textarea_set_selection(UIWIDGET textarea, int begin, int end) {

mercurial