From 8f9ef6f4e7430a9e0ad080dea8eaae6bcda23742 Mon Sep 17 00:00:00 2001 From: Rich Young Date: Fri, 6 Feb 2026 02:03:33 -0500 Subject: [PATCH] fix(templates/linux): update GTK4 runner header and focus --- .../app/linux-gtk4.tmpl/runner/my_application.cc.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/templates/app/linux-gtk4.tmpl/runner/my_application.cc.tmpl b/packages/flutter_tools/templates/app/linux-gtk4.tmpl/runner/my_application.cc.tmpl index 94d460068eb..d5cbd590953 100644 --- a/packages/flutter_tools/templates/app/linux-gtk4.tmpl/runner/my_application.cc.tmpl +++ b/packages/flutter_tools/templates/app/linux-gtk4.tmpl/runner/my_application.cc.tmpl @@ -30,6 +30,8 @@ static void my_application_activate(GApplication* application) { // Use a header bar as the default style for GNOME/GTK4 applications. GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_header_bar_set_show_title_buttons(header_bar, TRUE); + GtkWidget* title_label = gtk_label_new("{{projectName}}"); + gtk_header_bar_set_title_widget(header_bar, title_label); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); gtk_window_set_title(window, "{{projectName}}"); @@ -45,7 +47,8 @@ static void my_application_activate(GApplication* application) { // for transparent. gdk_rgba_parse(&background_color, "#000000"); fl_view_set_background_color(view, &background_color); - gtk_widget_show(GTK_WIDGET(view)); + gtk_widget_set_focusable(GTK_WIDGET(view), TRUE); + gtk_widget_set_visible(GTK_WIDGET(view), TRUE); gtk_window_set_child(window, GTK_WIDGET(view)); // Show the window when Flutter renders.