Commit 01c810b4 authored by Benjamin Otte's avatar Benjamin Otte

gdk: Remove new gdk_display_manager_peek() API

It's not necessary anymore because gdk_display_manager_get() always
succeeds and the value is independant of when it was called as it's no
longer backend specific.
parent 43e6b3aa
......@@ -382,9 +382,6 @@ gdk_display_open_default_libgtk_only (void)
g_return_val_if_fail (gdk_initialized, NULL);
if (gdk_display_manager_peek () == NULL)
return NULL;
display = gdk_display_get_default ();
if (display)
return display;
......
......@@ -253,36 +253,6 @@ gdk_set_allowed_backends (const gchar *backends)
allowed_backends = g_strdup (backends);
}
static GdkDisplayManager *manager = NULL;
/**
* gdk_display_manager_get:
*
* Gets the singleton #GdkDisplayManager object.
*
* When called for the first time, this function consults the
* <envar>GDK_BACKEND</envar> environment variable to find out which
* of the supported GDK backends to use (in case GDK has been compiled
* with multiple backends). Applications can use gdk_set_allowed_backends()
* to limit what backends can be used.
*
* Returns: (transfer none): The global #GdkDisplayManager singleton;
* gdk_parse_args(), gdk_init(), or gdk_init_check() must have
* been called first.
*
* Since: 2.2
**/
GdkDisplayManager*
gdk_display_manager_get (void)
{
gdk_display_manager_peek ();
if (manager == NULL)
g_error ("No GDK backend found (%s)", allowed_backends);
return manager;
}
typedef struct _GdkBackend GdkBackend;
struct _GdkBackend {
......@@ -311,20 +281,27 @@ static GdkBackend gdk_backends[] = {
};
/**
* gdk_display_manager_peek:
* gdk_display_manager_get:
*
* Gets the singleton #GdkDisplayManager object. If GDK could
* not be initialized, %NULL is returned.
* Gets the singleton #GdkDisplayManager object.
*
* When called for the first time, this function consults the
* <envar>GDK_BACKEND</envar> environment variable to find out which
* of the supported GDK backends to use (in case GDK has been compiled
* with multiple backends). Applications can use gdk_set_allowed_backends()
* to limit what backends can be used.
*
* Returns: (transfer none): The global #GdkDisplayManager singleton,
* or %NULL if GDK could not be initialized. gdk_parse_args(),
* gdk_init(), or gdk_init_check() must have been called first
* Returns: (transfer none): The global #GdkDisplayManager singleton;
* gdk_parse_args(), gdk_init(), or gdk_init_check() must have
* been called first.
*
* Since: 3.10
*/
GdkDisplayManager *
gdk_display_manager_peek (void)
* Since: 2.2
**/
GdkDisplayManager*
gdk_display_manager_get (void)
{
static GdkDisplayManager *manager = NULL;
if (manager == NULL)
manager = g_object_new (GDK_TYPE_DISPLAY_MANAGER, NULL);
......
......@@ -43,8 +43,6 @@ G_BEGIN_DECLS
GType gdk_display_manager_get_type (void) G_GNUC_CONST;
GdkDisplayManager *gdk_display_manager_get (void);
GDK_AVAILABLE_IN_3_10
GdkDisplayManager *gdk_display_manager_peek (void);
GdkDisplay * gdk_display_manager_get_default_display (GdkDisplayManager *manager);
void gdk_display_manager_set_default_display (GdkDisplayManager *manager,
GdkDisplay *display);
......
......@@ -525,17 +525,14 @@ _gtk_modules_init (gint *argc,
gtk_argv [*argc] = NULL;
}
display_manager = gdk_display_manager_peek ();
if (display_manager != NULL)
{
default_display_opened = gdk_display_get_default () != NULL;
g_signal_connect (display_manager, "notify::default-display",
G_CALLBACK (default_display_notify_cb),
NULL);
g_signal_connect (display_manager, "display-opened",
G_CALLBACK (display_opened_cb),
NULL);
}
display_manager = gdk_display_manager_get ();
default_display_opened = gdk_display_get_default () != NULL;
g_signal_connect (display_manager, "notify::default-display",
G_CALLBACK (default_display_notify_cb),
NULL);
g_signal_connect (display_manager, "display-opened",
G_CALLBACK (display_opened_cb),
NULL);
if (gtk_modules_args)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment