[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.1.0.3-51-gf684138

X2Go dev team git-admin at x2go.org
Wed Jan 8 15:26:34 CET 2014


The branch, build-baikal has been updated
       via  f684138dba366d5906d10dbdeb049607af66b296 (commit)
      from  1876820177d1e159a17e7b9315306b777e10238e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                  |    1 +
 x2go/backends/terminal/_stdout.py |    4 +++-
 x2go/defaults.py                  |    4 +++-
 x2go/utils.py                     |   14 ++++++++++++++
 4 files changed, 21 insertions(+), 2 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 5e8cef8..5665d64 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,7 @@ python-x2go (0.1.1.0-0~x2go1) UNRELEASED; urgency=low
     - Force 16bit colour depth for RDP-proxy sessions.
     - Faulty sessions (without a NX proxy fw tunnel) will get terminated whenever
       the X2go server (SSHd) denies the tunnel setup.
+    - Detect local color depth and use it as default for new sessions.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 23 Jun 2011 08:34:14 +0200
 
diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py
index 01269ba..018de14 100644
--- a/x2go/backends/terminal/_stdout.py
+++ b/x2go/backends/terminal/_stdout.py
@@ -61,6 +61,8 @@ from x2go.backends.info import X2goServerSessionList as _X2goServerSessionList
 from x2go.backends.proxy import X2goProxy as _X2goProxy
 from x2go.backends.printing import X2goClientPrinting as _X2goClientPrinting
 
+_local_color_depth = utils.local_color_depth()
+
 def _rewrite_cmd(cmd, params=None):
 
     # start with an empty string
@@ -179,7 +181,7 @@ class X2goTerminalSessionSTDOUT(object):
 
     """
     def __init__(self, control_session, session_info=None,
-                 geometry="800x600", depth=24, link="adsl", pack="16m-jpeg-9", 
+                 geometry="800x600", depth=_local_color_depth, link="adsl", pack="16m-jpeg-9", 
                  cache_type="unix-kde", 
                  keyboard='', kblayout='null', kbtype='null/null',
                  session_type="application", snd_system='pulse', snd_port=4713, cmd=None,
diff --git a/x2go/defaults.py b/x2go/defaults.py
index bfe8899..37bb434 100644
--- a/x2go/defaults.py
+++ b/x2go/defaults.py
@@ -29,6 +29,9 @@ import os
 import paramiko
 import platform
 
+## X2go imports
+import utils
+
 ##
 ## Common X2go defaults
 ##
@@ -81,7 +84,6 @@ else:
     class OSNotSupportedException(exceptions.StandardError): pass
     raise OSNotSupportedException('Platform %s is not supported' % platform.system())
 
-
 ##
 ## control and terminal session backend as well as session info and proxy backend defaults
 ##
diff --git a/x2go/utils.py b/x2go/utils.py
index dffca68..3dde3db 100644
--- a/x2go/utils.py
+++ b/x2go/utils.py
@@ -42,6 +42,9 @@ from defaults import X2GO_SESSIONPROFILE_DEFAULTS as _X2GO_SESSIONPROFILE_DEFAUL
 from defaults import X2GO_MIMEBOX_ACTIONS as _X2GO_MIMEBOX_ACTIONS
 from defaults import _pack_methods_nx3
 
+if _X2GOCLIENT_OS == 'Windows':
+    import win32api
+
 def is_in_nx3packmethods(method):
 
     """\
@@ -396,4 +399,15 @@ def xkb_rules_names():
     }
     return _rn_dict
 
+def local_color_depth():
+    """\
+    Detect the current local screen's color depth.
 
+    """
+    if _X2GOCLIENT_OS != 'Windows':
+        p = subprocess.Popen(['xwininfo', '-root',], stdout=subprocess.PIPE, )
+        _depth_line = [ _info.strip() for _info in p.stdout.read().split('\n') if 'Depth:' in _info ][0]
+        _depth = _depth_line.split(' ')[1]
+        return int(_depth)
+    else:
+        return win32api.GetSystemMetrics(2)


hooks/post-receive
-- 
python-x2go.git (Python X2Go Client API)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-x2go.git" (Python X2Go Client API).




More information about the x2go-commits mailing list