[Xfce4-commits] <xfce4-session:jeromeg/libxfce4ui> Replace xfce_gdk_screen_get_fullname with custom code.
Jérôme Guelfucci
noreply at xfce.org
Fri Jan 22 23:56:02 CET 2010
Updating branch refs/heads/jeromeg/libxfce4ui
to 6f89f629b1e48f7902b8cf1c85ce1e2843c4f921 (commit)
from d72e1c4642021eb466f751ce1cff275d1881e738 (commit)
commit 6f89f629b1e48f7902b8cf1c85ce1e2843c4f921
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Fri Jan 22 18:22:19 2010 +0100
Replace xfce_gdk_screen_get_fullname with custom code.
This function has not been implemented in libxfce4ui because xfce4-session
is the only application to use. Copy and adapt the code from libxfcegui4.
libxfsm/xfsm-util.c | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/libxfsm/xfsm-util.c b/libxfsm/xfsm-util.c
index d664d9e..1a76a79 100644
--- a/libxfsm/xfsm-util.c
+++ b/libxfsm/xfsm-util.c
@@ -75,7 +75,44 @@ xfsm_start_application (gchar **command,
if (screen != NULL)
{
if (client_machine != NULL)
- screen_name = xfce_gdk_screen_get_fullname (screen);
+ {
+ const gchar *name;
+ const gchar *np;
+ GdkDisplay *display;
+ gchar *hostname;
+ gchar buffer[256];
+ gchar *bp;
+
+ display = gdk_screen_get_display (screen);
+
+ name = gdk_display_get_name (display);
+ if (*name == ':')
+ {
+ hostname = xfce_gethostname ();
+ g_strlcpy (buffer, hostname, 256);
+ g_free (hostname);
+
+ bp = buffer + strlen (buffer);
+
+ for (np = name; *np != '\0' && *np != '.' && bp < buffer + 255; )
+ *bp++ = *np++;
+ *bp = '\0';
+ }
+ else
+ {
+ g_strlcpy (buffer, name, 256);
+
+ for (bp = buffer + strlen (buffer) - 1; *bp != ':'; --bp)
+ if (*bp == '.')
+ {
+ *bp = '\0';
+ break;
+ }
+ }
+
+ screen_name = g_strdup_printf ("%s.%d", buffer,
+ gdk_screen_get_number (screen));
+ }
else
screen_name = gdk_screen_make_display_name (screen);
argv[argc++] = g_strdup ("env");
More information about the Xfce4-commits
mailing list