[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.2.0.10-17-ga737395
X2Go dev team
git-admin at x2go.org
Wed Jan 8 15:29:22 CET 2014
The branch, build-baikal has been updated
via a737395d986559888c214c894cce07d614bab78a (commit)
from d71817b8ec2e482fa41d2bd5fb5a6e5c5c7f66f5 (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 | 2 ++
x2go/backends/terminal/_stdout.py | 16 ++++++++++++++--
x2go/utils.py | 21 +++++++++++++++++++++
3 files changed, 37 insertions(+), 2 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 2f8b04c..9940594 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ python-x2go (0.2.0.11-0~x2go1) UNRELEASED; urgency=low
- Add support for starting maximized session windows. Closes upstream
issue #12.
- Fix category ,,Utility'' when parsing .desktop files.
+ - For ,,maxdim'' session property fallback to _NET_DESKTOP_GEOMETRY if
+ _NET_WORKAREA is not available from the window manager.
* /debian/rules:
+ Allow package build on systems with missing dh_python2.
diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py
index 8548cd0..4055f09 100644
--- a/x2go/backends/terminal/_stdout.py
+++ b/x2go/backends/terminal/_stdout.py
@@ -1375,7 +1375,13 @@ class X2goTerminalSessionSTDOUT(object):
self.params.rewrite_session_type()
if self.params.geometry == 'maximize':
- self.params.geometry = "%sx%s" % utils.get_workarea_geometry()
+ _geometry = utils.get_workarea_geometry()
+ if len(_geometry) != 2:
+ _geometry = utils.get_desktop_geometry()
+ if len(_geometry) == 2:
+ self.params.geometry = "%sx%s" % _geometry
+ else:
+ self.logger('failed to detect best maxmimized geometry of your client-side desktop', loglevel=log.loglevel_WARN)
cmd_line = [ "x2gostartagent",
str(self.params.geometry),
@@ -1462,7 +1468,13 @@ class X2goTerminalSessionSTDOUT(object):
setkbd = "1"
if self.params.geometry == 'maximize':
- self.params.geometry = "%sx%s" % utils.get_workarea_geometry()
+ _geometry = utils.get_workarea_geometry()
+ if len(_geometry) != 2:
+ _geometry = utils.get_desktop_geometry()
+ if len(_geometry) == 2:
+ self.params.geometry = "%sx%s" % _geometry
+ else:
+ self.logger('failed to detect best maxmimized geometry of your client-side desktop', loglevel=log.loglevel_WARN)
cmd_line = [ "x2goresume-session", self.session_info.name,
self.params.geometry,
diff --git a/x2go/utils.py b/x2go/utils.py
index a6ee4e6..ff240dd 100644
--- a/x2go/utils.py
+++ b/x2go/utils.py
@@ -603,6 +603,27 @@ def find_session_window(session_name):
return window
+def get_desktop_geometry():
+ """\
+ Get the geometry of the current screen's desktop by
+ wrapping around
+
+ xprop -root '_NET_DESKTOP_GEOMETRY'
+
+ @return: a (<width>, <height>) tuple will be returned
+ @rtype: C{tuple}
+
+ """
+ if _X2GOCLIENT_OS != 'Windows':
+ p = subprocess.Popen(['xprop', '-root', '_NET_DESKTOP_GEOMETRY',], stdout=subprocess.PIPE, )
+ _paramval = p.stdout.read().split("=")
+ if len(_paramval) == 2:
+ _list = _paramval[1].rstrip('\n').split(',')
+ if len(_list) == 2:
+ return (_list[0].strip(), _list[1].strip())
+
+ return None
+
def get_workarea_geometry():
"""\
Get the geometry of the current screen's work area by
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