GTK4: Change gtk_window_new to gtk_application_window_new
authorColin Clark <[email protected]>
Sat, 12 Apr 2025 12:44:54 +0000 (13:44 +0100)
committerColin Clark <[email protected]>
Sat, 12 Apr 2025 12:44:54 +0000 (13:44 +0100)
GTK4 migration

src/window.cc

index 888d3132b4c9b872121a9fc444717adf1bb20b55..8034ae76d5f7495df48ac17217fc033e9ef5d868 100644 (file)
@@ -113,11 +113,9 @@ GtkWidget *window_new(const gchar *role, const gchar *icon, const gchar *icon_fi
        g_autofree gchar *title = nullptr;
        GtkWidget *window;
 
-#if HAVE_GTK4
-       window = gtk_window_new();
-#else
-       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-#endif
+       GApplication *app = g_application_get_default();
+       window = gtk_application_window_new(GTK_APPLICATION(app));
+
        if (!window) return nullptr;
 
        if (subtitle)