[nautilus/wip/antoniof/gnome-42: 44/72] Revert "application: Stop using GdkScreen for style providers"




commit 99f82c86ac000b0dab5c6285f04fe840e258b675
Author: António Fernandes <antoniof gnome org>
Date:   Fri Feb 11 19:01:53 2022 +0000

    Revert "application: Stop using GdkScreen for style providers"
    
    This reverts commit 0d256234f5f6c804cef0cff066e23fd9efff6422.

 src/nautilus-application.c  | 20 ++++++++++----------
 src/nautilus-gtk4-helpers.c | 18 ------------------
 src/nautilus-gtk4-helpers.h |  7 -------
 3 files changed, 10 insertions(+), 35 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 76ac83fea..348dae188 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1121,11 +1121,11 @@ theme_changed (GtkSettings *settings)
     static GtkCssProvider *provider = NULL;
     static GtkCssProvider *permanent_provider = NULL;
     gchar *theme;
-    GdkDisplay *display;
+    GdkScreen *screen;
     GFile *file;
 
     g_object_get (settings, "gtk-theme-name", &theme, NULL);
-    display = gdk_display_get_default ();
+    screen = gdk_screen_get_default ();
 
     /* CSS that themes can override */
     if (g_str_equal (theme, "Adwaita") || g_str_equal (theme, "Adwaita-dark"))
@@ -1138,14 +1138,14 @@ theme_changed (GtkSettings *settings)
             g_object_unref (file);
         }
 
-        gtk_style_context_add_provider_for_display (display,
-                                                    GTK_STYLE_PROVIDER (provider),
-                                                    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+        gtk_style_context_add_provider_for_screen (screen,
+                                                   GTK_STYLE_PROVIDER (provider),
+                                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
     }
     else if (provider != NULL)
     {
-        gtk_style_context_remove_provider_for_display (display,
-                                                       GTK_STYLE_PROVIDER (provider));
+        gtk_style_context_remove_provider_for_screen (screen,
+                                                      GTK_STYLE_PROVIDER (provider));
         g_clear_object (&provider);
     }
 
@@ -1159,9 +1159,9 @@ theme_changed (GtkSettings *settings)
          * undefined and gtk happens to prefer the provider that got added last.
          * Use a higher priority here to avoid this problem.
          */
-        gtk_style_context_add_provider_for_display (display,
-                                                    GTK_STYLE_PROVIDER (permanent_provider),
-                                                    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
+        gtk_style_context_add_provider_for_screen (screen,
+                                                   GTK_STYLE_PROVIDER (permanent_provider),
+                                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
         g_object_unref (file);
     }
 
diff --git a/src/nautilus-gtk4-helpers.c b/src/nautilus-gtk4-helpers.c
index 98bea9c06..a4c5ac679 100644
--- a/src/nautilus-gtk4-helpers.c
+++ b/src/nautilus-gtk4-helpers.c
@@ -140,21 +140,3 @@ gtk_window_set_display (GtkWindow  *window,
 
     gtk_window_set_screen (window, gdk_display_get_default_screen (display));
 }
-
-void
-gtk_style_context_add_provider_for_display (GdkDisplay       *display,
-                                            GtkStyleProvider *provider,
-                                            guint             priority)
-{
-    gtk_style_context_add_provider_for_screen (gdk_display_get_default_screen (display),
-                                               provider,
-                                               priority);
-}
-
-void
-gtk_style_context_remove_provider_for_display (GdkDisplay       *display,
-                                               GtkStyleProvider *provider)
-{
-    gtk_style_context_remove_provider_for_screen (gdk_display_get_default_screen (display),
-                                                  provider);
-}
diff --git a/src/nautilus-gtk4-helpers.h b/src/nautilus-gtk4-helpers.h
index 6763788cb..9ffacc1e1 100644
--- a/src/nautilus-gtk4-helpers.h
+++ b/src/nautilus-gtk4-helpers.h
@@ -33,13 +33,6 @@ void gtk_check_button_set_active   (GtkCheckButton    *button,
 gboolean gtk_check_button_get_active (GtkCheckButton  *button);
 GtkWidget *gtk_widget_get_first_child (GtkWidget *widget);
 
-
-void gtk_style_context_add_provider_for_display    (GdkDisplay       *display,
-                                                    GtkStyleProvider *provider,
-                                                    guint             priority);
-void gtk_style_context_remove_provider_for_display (GdkDisplay       *display,
-                                                    GtkStyleProvider *provider);
-
 #define GTK_ROOT(root) ((GtkRoot *) GTK_WINDOW (root))
 typedef GtkWindow GtkRoot;
 GdkDisplay *gtk_root_get_display   (GtkRoot           *root);


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