[sysprof/wip/gtk4-port: 63/125] application: port to GTK 4




commit 1189075b154fbfad8df91ee04b604641ae7e9e1c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 1 10:35:40 2021 -0700

    application: port to GTK 4

 src/sysprof/sysprof-application.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/src/sysprof/sysprof-application.c b/src/sysprof/sysprof-application.c
index 157d4d3f..f30bc82f 100644
--- a/src/sysprof/sysprof-application.c
+++ b/src/sysprof/sysprof-application.c
@@ -120,16 +120,16 @@ sysprof_application_startup (GApplication *application)
 
   provider = gtk_css_provider_new ();
   gtk_css_provider_load_from_resource (provider, "/org/gnome/sysprof/theme/shared.css");
-  gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
-                                             GTK_STYLE_PROVIDER (provider),
-                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+                                              GTK_STYLE_PROVIDER (provider),
+                                              GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 
 #ifdef DEVELOPMENT_BUILD
   adwaita = gtk_css_provider_new ();
   gtk_css_provider_load_from_resource (adwaita, "/org/gnome/sysprof/theme/Adwaita-shared.css");
-  gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
-                                             GTK_STYLE_PROVIDER (adwaita),
-                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+                                              GTK_STYLE_PROVIDER (adwaita),
+                                              GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 #endif
 
   for (guint i = 0; default_accels[i].action_name; i++)
@@ -207,7 +207,7 @@ sysprof_about (GSimpleAction *action,
 
   g_signal_connect (dialog,
                     "response",
-                    G_CALLBACK (gtk_widget_destroy),
+                    G_CALLBACK (gtk_window_destroy),
                     NULL);
 
   gtk_window_present (dialog);
@@ -226,10 +226,7 @@ sysprof_help (GSimpleAction *action,
 
   window = gtk_application_get_active_window (GTK_APPLICATION (self));
 
-  gtk_show_uri_on_window (window,
-                          "help:sysprof",
-                          gtk_get_current_event_time (),
-                          NULL);
+  gtk_show_uri (window, "help:sysprof", GDK_CURRENT_TIME);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]