summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2009-03-30 14:07:27 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2009-03-30 14:07:27 +0800
commit15e6b996bc63dcc6cf97802ce1905d2aa582144c (patch)
tree23ab79a5fcfbcdecb2121e694358b7983adad59a
parent7600d42c7cb5ccd91f1da694e8196fc8f57cba7d (diff)
downloadibus-15e6b996bc63dcc6cf97802ce1905d2aa582144c.tar.gz
ibus-15e6b996bc63dcc6cf97802ce1905d2aa582144c.tar.xz
ibus-15e6b996bc63dcc6cf97802ce1905d2aa582144c.zip
Does not include X screen number in socket address.
-rw-r--r--ibus/common.py8
-rw-r--r--src/ibusshare.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/ibus/common.py b/ibus/common.py
index e9868ee..9b4c22b 100644
--- a/ibus/common.py
+++ b/ibus/common.py
@@ -47,9 +47,9 @@ __all__ = (
import os
import sys
-display = os.environ["DISPLAY"]
-if "." not in display:
- display += ".0"
+__display = os.environ["DISPLAY"]
+__hostname, __display_screen = __display.split(":", 1)
+__display_number = __display_screen.split(".")[0]
__username = None
try:
@@ -65,7 +65,7 @@ if not __username:
if not __username:
__username = os.getenv ("USERNAME")
-IBUS_ADDR = "unix:path=/tmp/ibus-%s/ibus-%s" % (__username, display.replace(":", "-"))
+IBUS_ADDR = "unix:path=/tmp/ibus-%s/ibus-%s-%s" % (__username, __hostname, __display_number)
# IBUS_ADDR = "tcp:host=localhost,port=7799"
IBUS_IFACE_IBUS = "org.freedesktop.IBus"
diff --git a/src/ibusshare.c b/src/ibusshare.c
index 26a6480..510b2be 100644
--- a/src/ibusshare.c
+++ b/src/ibusshare.c
@@ -98,8 +98,8 @@ ibus_get_socket_path (void)
username = ibus_get_user_name ();
path = g_strdup_printf (
- "/tmp/ibus-%s/ibus-%s-%s.%s",
- username, hostname, displaynumber, screennumber);
+ "/tmp/ibus-%s/ibus-%s-%s",
+ username, hostname, displaynumber);
g_free (display);
}