[gtk+] Add gtk_settings_get_for_display



commit f9cc7ca1406b14bdbb9fd52c10a7600ff1f38026
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 30 16:50:14 2017 -0400

    Add gtk_settings_get_for_display
    
    This will help us avoiding screens in many places.

 gtk/gtksettings.c |    4 +++-
 gtk/gtksettings.h |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index b89a6f6..94c4c83 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1247,11 +1247,13 @@ gtk_settings_create_for_display (GdkDisplay *display)
   return settings;
 }
 
-static GtkSettings *
+GtkSettings *
 gtk_settings_get_for_display (GdkDisplay *display)
 {
   int i;
 
+  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+
   if G_UNLIKELY (display_settings == NULL)
     display_settings = g_ptr_array_new ();
 
diff --git a/gtk/gtksettings.h b/gtk/gtksettings.h
index 624a3de..1bd958b 100644
--- a/gtk/gtksettings.h
+++ b/gtk/gtksettings.h
@@ -91,6 +91,8 @@ GDK_AVAILABLE_IN_ALL
 GtkSettings*    gtk_settings_get_default             (void);
 GDK_AVAILABLE_IN_ALL
 GtkSettings*    gtk_settings_get_for_screen          (GdkScreen *screen);
+GDK_AVAILABLE_IN_3_94
+GtkSettings*    gtk_settings_get_for_display         (GdkDisplay *display);
 
 /* --- precoded parsing functions --- */
 GDK_AVAILABLE_IN_ALL


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