From cb065a0f698d5322825286c7d94c568c2d4a74f2 Mon Sep 17 00:00:00 2001 From: Suriya Date: Thu, 6 Aug 2026 17:11:10 +0530 Subject: [PATCH] Put back the Linux runner and .clangd formatting Swept into the previous commit by a git add -A while a formatter had run over them in the background. Unrelated to that commit's subject, and the C++ change flipped pointer style away from what the Flutter template ships, so it would come back on every regenerate and churn again. Co-Authored-By: Claude Opus 5 --- .clangd | 4 ++-- linux/runner/my_application.cc | 40 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.clangd b/.clangd index 7dc2d8a..87eea78 100644 --- a/.clangd +++ b/.clangd @@ -20,8 +20,8 @@ # If you do want real analysis of this directory, do it on Linux with the GTK # headers present and a compile_commands.json — not by editing the runner. If: - PathMatch: [.*linux/.*, linux/.*] + PathMatch: linux/.* Diagnostics: - Suppress: ["*"] + Suppress: '*' UnusedIncludes: None diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc index 646db85..e383bf9 100644 --- a/linux/runner/my_application.cc +++ b/linux/runner/my_application.cc @@ -9,20 +9,20 @@ struct _MyApplication { GtkApplication parent_instance; - char **dart_entrypoint_arguments; + char** dart_entrypoint_arguments; }; G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) // Called when first Flutter frame received. -static void first_frame_cb(MyApplication *self, FlView *view) { +static void first_frame_cb(MyApplication* self, FlView* view) { gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); } // Implements GApplication::activate. -static void my_application_activate(GApplication *application) { - MyApplication *self = MY_APPLICATION(application); - GtkWindow *window = +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); // Use a header bar when running in GNOME as this is the common style used @@ -34,16 +34,16 @@ static void my_application_activate(GApplication *application) { // if future cases occur). gboolean use_header_bar = TRUE; #ifdef GDK_WINDOWING_X11 - GdkScreen *screen = gtk_window_get_screen(window); + GdkScreen* screen = gtk_window_get_screen(window); if (GDK_IS_X11_SCREEN(screen)) { - const gchar *wm_name = gdk_x11_screen_get_window_manager_name(screen); + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); if (g_strcmp0(wm_name, "GNOME Shell") != 0) { use_header_bar = FALSE; } } #endif if (use_header_bar) { - GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); gtk_header_bar_set_title(header_bar, "nearle_pos"); gtk_header_bar_set_show_close_button(header_bar, TRUE); @@ -58,7 +58,7 @@ static void my_application_activate(GApplication *application) { fl_dart_project_set_dart_entrypoint_arguments( project, self->dart_entrypoint_arguments); - FlView *view = fl_view_new(project); + FlView* view = fl_view_new(project); GdkRGBA background_color; // Background defaults to black, override it here if necessary, e.g. #00000000 // for transparent. @@ -79,10 +79,10 @@ static void my_application_activate(GApplication *application) { } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication *application, - gchar ***arguments, - int *exit_status) { - MyApplication *self = MY_APPLICATION(application); +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { + MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); @@ -100,7 +100,7 @@ static gboolean my_application_local_command_line(GApplication *application, } // Implements GApplication::startup. -static void my_application_startup(GApplication *application) { +static void my_application_startup(GApplication* application) { // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application startup. @@ -109,7 +109,7 @@ static void my_application_startup(GApplication *application) { } // Implements GApplication::shutdown. -static void my_application_shutdown(GApplication *application) { +static void my_application_shutdown(GApplication* application) { // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application shutdown. @@ -118,13 +118,13 @@ static void my_application_shutdown(GApplication *application) { } // Implements GObject::dispose. -static void my_application_dispose(GObject *object) { - MyApplication *self = MY_APPLICATION(object); +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); G_OBJECT_CLASS(my_application_parent_class)->dispose(object); } -static void my_application_class_init(MyApplicationClass *klass) { +static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; @@ -133,9 +133,9 @@ static void my_application_class_init(MyApplicationClass *klass) { G_OBJECT_CLASS(klass)->dispose = my_application_dispose; } -static void my_application_init(MyApplication *self) {} +static void my_application_init(MyApplication* self) {} -MyApplication *my_application_new() { +MyApplication* my_application_new() { // Set the program name to the application ID, which helps various systems // like GTK and desktop environments map this running application to its // corresponding .desktop file. This ensures better integration by allowing