[gtk+/broadway: 235/246] broadway: Make broadway port configurable with BROADWAY_DISPLAY
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/broadway: 235/246] broadway: Make broadway port configurable with BROADWAY_DISPLAY
- Date: Tue, 15 Mar 2011 12:00:47 +0000 (UTC)
commit 084003953d0e1af9d0ab3c778df4b45965ec40da
Author: Alexander Larsson <alexl redhat com>
Date: Mon Mar 14 15:58:55 2011 +0100
broadway: Make broadway port configurable with BROADWAY_DISPLAY
gdk/broadway/gdkdisplay-broadway.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index f0e8dc1..4651ed1 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -679,6 +679,7 @@ _gdk_broadway_display_open (const gchar *display_name)
GdkDisplay *display;
GdkBroadwayDisplay *broadway_display;
GError *error;
+ int port;
display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
broadway_display = GDK_BROADWAY_DISPLAY (display);
@@ -706,9 +707,18 @@ _gdk_broadway_display_open (const gchar *display_name)
_gdk_broadway_screen_setup (broadway_display->screens[0]);
+ if (display_name == NULL)
+ display_name = g_getenv ("BROADWAY_DISPLAY");
+
+ port = 0;
+ if (display_name != NULL)
+ port = strtol(display_name, NULL, 10);
+ if (port == 0)
+ port = 8080;
+
broadway_display->service = g_socket_service_new ();
if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (broadway_display->service),
- 8080,
+ port,
G_OBJECT (display),
&error))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]