[X2Go-Commits] python-x2go.git - twofactorauth (branch) updated: 0.4.0.8-24-gfd9fe92

X2Go dev team git-admin at x2go.org
Thu Oct 24 09:50:45 CEST 2013


The branch, twofactorauth has been updated
       via  fd9fe9272f204deb7aa0f608950aa7bc2d633fdc (commit)
      from  efcb8afc6c0efd744ffa60db340efdceaac196ac (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 -----------------------------------------------------------------
commit fd9fe9272f204deb7aa0f608950aa7bc2d633fdc
Author: Kenneth Pedersen <kenneth at wangpedersen.com>
Date:   Thu Oct 24 09:50:00 2013 +0200

    Color depth detection: Stop using win32api.GetSystemMetrics(2) which actually returns the width of a vertical scroll bar in pixels. Instead, create a screen display context and query it for the color depth. (Fixes: #330).

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    7 +++++++
 x2go/utils.py    |    9 ++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 8aa3264..58ba6fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 python-x2go (0.4.0.9-0~x2go1) UNRELEASED; urgency=low
 
+  [ Mike Gabriel ]
   * New upstream version (0.4.0.9):
     - Agent channels in Paramiko can raise an EOFError if the connection
       has got disrupted. Ignoring this.
@@ -21,6 +22,12 @@ python-x2go (0.4.0.9-0~x2go1) UNRELEASED; urgency=low
     - Warn about Parmiko/SSH versions that do not yet support twofactor
       authentication with password/passphrase being different.
 
+  [ Kenneth Pedersen ]
+  * New upstream version (0.4.0.9):
+    - Color depth detection: Stop using win32api.GetSystemMetrics(2) which actually
+      returns the width of a vertical scroll bar in pixels. Instead, create a screen
+      display context and query it for the color depth. (Fixes: #330).
+
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 07 Aug 2013 12:18:46 +0200
 
 python-x2go (0.4.0.8-0~x2go1) unstable; urgency=low
diff --git a/x2go/utils.py b/x2go/utils.py
index e8d80bc..c6db2de 100644
--- a/x2go/utils.py
+++ b/x2go/utils.py
@@ -46,8 +46,9 @@ if _X2GOCLIENT_OS != 'Windows':
     from defaults import X_DISPLAY as _X_DISPLAY
 
 if _X2GOCLIENT_OS == 'Windows':
-    import win32api
     import win32gui
+    import win32print
+    import win32con
 
 def is_in_nx3packmethods(method):
 
@@ -555,8 +556,10 @@ def local_color_depth():
             return 24
 
     else:
-        return win32api.GetSystemMetrics(2)
-
+        # This gets the color depth of the primary monitor. All monitors need not have the same color depth.
+        dc = win32gui.GetDC(None)
+        _depth = win32print.GetDeviceCaps(dc, win32con.BITSPIXEL) * win32print.GetDeviceCaps(dc, win32con.PLANES)
+        win32gui.ReleaseDC(None, dc)
 
 def is_color_depth_ok(depth_session, depth_local):
     """\


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