[gtk+] x11: Make gdk_x11_display_open() public API



commit 161f891d559366f8d55a741121f1f6ced6c8d1bc
Author: Benjamin Otte <otte redhat com>
Date:   Wed Nov 1 15:31:36 2017 +0100

    x11: Make gdk_x11_display_open() public API
    
    People should be able to explicitily open displays to their backends.

 docs/reference/gdk/gdk4-sections.txt |    1 +
 gdk/gdkdisplaymanager.c              |    2 +-
 gdk/x11/gdkdisplay-x11.c             |   14 +++++++++++++-
 gdk/x11/gdkprivate-x11.h             |    1 -
 gdk/x11/gdkx11display.h              |    3 +++
 5 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 8722f67..745c790 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -921,6 +921,7 @@ gdk_x11_lookup_xdisplay
 gdk_x11_get_server_time
 gdk_x11_device_get_id
 gdk_x11_device_manager_lookup
+gdk_x11_display_open
 gdk_x11_display_get_user_time
 gdk_x11_display_broadcast_startup_message
 gdk_x11_display_get_startup_notification_id
diff --git a/gdk/gdkdisplaymanager.c b/gdk/gdkdisplaymanager.c
index c3e32c2..a21aa67 100644
--- a/gdk/gdkdisplaymanager.c
+++ b/gdk/gdkdisplaymanager.c
@@ -276,7 +276,7 @@ static GdkBackend gdk_backends[] = {
   { "mir",      _gdk_mir_display_open },
 #endif
 #ifdef GDK_WINDOWING_X11
-  { "x11",      _gdk_x11_display_open },
+  { "x11",      gdk_x11_display_open },
 #endif
 #ifdef GDK_WINDOWING_BROADWAY
   { "broadway", _gdk_broadway_display_open },
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index af54a99..432ac34 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1532,8 +1532,20 @@ gdk_display_setup_window_visual (GdkDisplay *display,
   gdk_display_set_rgba (display, rgba);
 }
 
+/**
+ * gdk_x11_display_open:
+ * @display_name: (allow-none): name of the X display.
+ *     See the XOpenDisplay() for details.
+ *
+ * Tries to open a new display to the X server given by
+ * @display_name. If opening the display fails, %NULL is
+ * returned.
+ *
+ * Returns: (nullable) (transfer full): The new display or
+ *     %NULL on error.
+ **/
 GdkDisplay *
-_gdk_x11_display_open (const gchar *display_name)
+gdk_x11_display_open (const gchar *display_name)
 {
   Display *xdisplay;
   GdkDisplay *display;
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 59b5e36..0d7a571 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -137,7 +137,6 @@ void _gdk_x11_window_grab_check_destroy (GdkWindow *window);
 gboolean _gdk_x11_display_is_root_window (GdkDisplay *display,
                                           Window      xroot_window);
 
-GdkDisplay * _gdk_x11_display_open            (const gchar *display_name);
 void _gdk_x11_display_update_grab_info        (GdkDisplay *display,
                                                GdkDevice  *device,
                                                gint        status);
diff --git a/gdk/x11/gdkx11display.h b/gdk/x11/gdkx11display.h
index 703aec7..445f024 100644
--- a/gdk/x11/gdkx11display.h
+++ b/gdk/x11/gdkx11display.h
@@ -53,6 +53,9 @@ typedef struct _GdkX11DisplayClass GdkX11DisplayClass;
 GDK_AVAILABLE_IN_ALL
 GType      gdk_x11_display_get_type            (void);
 
+GDK_AVAILABLE_IN_3_94
+GdkDisplay *  gdk_x11_display_open        (const char  *display_name);
+
 GDK_AVAILABLE_IN_ALL
 Display *gdk_x11_display_get_xdisplay     (GdkDisplay  *display);
 


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