[gtk+] gdk: Remove gdk_get_display_arg_name()



commit 2d31a5499a5484e72dc30fe573d5934d8560361f
Author: Benjamin Otte <otte redhat com>
Date:   Wed Nov 1 18:26:34 2017 +0100

    gdk: Remove gdk_get_display_arg_name()
    
    Since we're no longer allowing arguments, this is always NULL now.

 docs/reference/gdk/gdk4-sections.txt |    1 -
 gdk/gdk.c                            |   23 +----------------------
 gdk/gdkglobals.c                     |    2 --
 gdk/gdkinternals.h                   |    2 --
 gdk/gdkmain.h                        |    4 ----
 gdk/x11/gdkmain-x11.c                |    4 ++--
 gtk/gtkmain.c                        |    2 +-
 7 files changed, 4 insertions(+), 34 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 745c790..a39abe6 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -4,7 +4,6 @@
 <SECTION>
 <TITLE>General</TITLE>
 <FILE>general</FILE>
-gdk_get_display_arg_name
 gdk_notify_startup_complete
 gdk_notify_startup_complete_with_id
 gdk_set_allowed_backends
diff --git a/gdk/gdk.c b/gdk/gdk.c
index f26696c..2f039c0 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -241,27 +241,6 @@ gdk_pre_parse (void)
     }
 }
 
-/**
- * gdk_get_display_arg_name:
- *
- * Gets the display name specified in the command line arguments passed
- * to gdk_init() or gdk_parse_args(), if any.
- *
- * Returns: (nullable): the display name, if specified explicitly,
- *   otherwise %NULL this string is owned by GTK+ and must not be
- *   modified or freed.
- *
- * Since: 2.2
- */
-const gchar *
-gdk_get_display_arg_name (void)
-{
-  if (!_gdk_display_arg_name)
-    _gdk_display_arg_name = g_strdup (_gdk_display_name);
-
-   return _gdk_display_arg_name;
-}
-
 /*< private >
  * gdk_display_open_default:
  *
@@ -285,7 +264,7 @@ gdk_display_open_default (void)
   if (display)
     return display;
 
-  display = gdk_display_open (gdk_get_display_arg_name ());
+  display = gdk_display_open (NULL);
 
   return display;
 }
diff --git a/gdk/gdkglobals.c b/gdk/gdkglobals.c
index ed3b15c..d970a8d 100644
--- a/gdk/gdkglobals.c
+++ b/gdk/gdkglobals.c
@@ -31,8 +31,6 @@
 
 guint               _gdk_debug_flags = 0;
 GList              *_gdk_default_filters = NULL;
-gchar              *_gdk_display_name = NULL;
-gchar              *_gdk_display_arg_name = NULL;
 gboolean            _gdk_disable_multidevice = FALSE;
 guint               _gdk_gl_flags = 0;
 guint               _gdk_vulkan_flags = 0;
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 06d1fa7..f8393ee 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -293,9 +293,7 @@ struct _GdkWindow
 #define GDK_WINDOW_TYPE(d) ((((GdkWindow *)(d)))->window_type)
 #define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed)
 
-extern gchar     *_gdk_display_name;
 extern gint       _gdk_screen_number;
-extern gchar     *_gdk_display_arg_name;
 extern gboolean   _gdk_disable_multidevice;
 
 GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
diff --git a/gdk/gdkmain.h b/gdk/gdkmain.h
index b1e9c13..82ce9a4 100644
--- a/gdk/gdkmain.h
+++ b/gdk/gdkmain.h
@@ -62,10 +62,6 @@ void                           gdk_error_trap_pop_ignored (void);
 
 
 GDK_AVAILABLE_IN_ALL
-const gchar *         gdk_get_display_arg_name (void);
-
-
-GDK_AVAILABLE_IN_ALL
 void gdk_set_double_click_time (guint msec);
 
 GDK_AVAILABLE_IN_ALL
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 19fd6fe..e8a4c49 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -242,14 +242,14 @@ gdk_x_io_error (Display *display)
                  "most likely the X server was shut down or you killed/destroyed\n"
                  "the application.\n",
                  g_get_prgname (),
-                 display ? DisplayString (display) : gdk_get_display_arg_name ());
+                 display ? DisplayString (display) : NULL);
     }
   else
     {
       g_message ("%s: Fatal IO error %d (%s) on X server %s.\n",
                  g_get_prgname (),
                  errno, g_strerror (errno),
-                 display ? DisplayString (display) : gdk_get_display_arg_name ());
+                 display ? DisplayString (display) : NULL);
     }
 
   _exit (1);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index ae46512..a626438 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -824,7 +824,7 @@ gtk_init (void)
 {
   if (!gtk_init_check ())
     {
-      const char *display_name_arg = gdk_get_display_arg_name ();
+      const char *display_name_arg = NULL;
       if (display_name_arg == NULL)
         display_name_arg = getenv ("DISPLAY");
       g_warning ("cannot open display: %s", display_name_arg ? display_name_arg : "");


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