[X2Go-Commits] python-x2go.git - release/0.4.0.x (branch) updated: 0.1.1.4-209-g38a2aa4

X2Go dev team git-admin at x2go.org
Tue Jan 7 16:17:53 CET 2014


The branch, release/0.4.0.x has been updated
       via  38a2aa49b61bb51a1fbcb700de9bf1d58560e0d1 (commit)
      from  393c1297895e723167977505e45df18e4f903b5a (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 |    3 +++
 x2go/client.py   |   27 +++++++++++++++++++++------
 x2go/xserver.py  |    2 +-
 3 files changed, 25 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 1042ea1..87e643a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -106,6 +106,9 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
       the next available display number.
     - Make transitions of master sessions more robust. Only allow local folder sharing for
       running sessions.
+    - Re-use a left behind stray X-server that might have not get killed by
+      a previous instance of Python X2Go Client. This trick is nasty, but works
+      around faulty abortion of client implementations.
   * Depend on python-xlib.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sat, 28 Sep 2012 01:44:21 +0100
diff --git a/x2go/client.py b/x2go/client.py
index c64259e..3968bb1 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -292,22 +292,37 @@ class X2goClient(object):
             self.client_printing = self.printing_backend(client_instance=self, logger=self.logger)
 
         if _X2GOCLIENT_OS == 'Windows' and start_xserver:
+
             if self.client_rootdir:
                 self.client_xconfig = X2goClientXConfig(config_files=[_xconfig_config_file], logger=self.logger)
             else:
                 self.client_xconfig = X2goClientXConfig(logger=self.logger)
+
             if not self.client_xconfig.known_xservers:
                 self.HOOK_no_known_xserver_found()
-            elif not self.client_xconfig.running_xservers:
+            else:
+
                 if  type(start_xserver) is types.BooleanType:
                     p_xs = self.client_xconfig.preferred_xserver
                 elif type(start_xserver) is types.StringType:
                     p_xs = (start_xserver, self.client_xconfig.get_xserver_config(start_xserver))
-                if p_xs is not None:
-                    self.xserver = X2goXServer(p_xs[0], p_xs[1], logger=self.logger)
-            else:
-                # presume the running XServer listens on :0
-                os.environ.update({'DISPLAY': 'localhost:0'})
+
+                if not self.client_xconfig.running_xservers:
+
+                    if p_xs is not None:
+                        self.xserver = X2goXServer(p_xs[0], p_xs[1], logger=self.logger)
+
+                else:
+
+                    if p_xs is not None:
+                        #
+                        # FIXME: this trick is nasty, client implementation should rather cleanly shutdown launch X-server processes
+                        # 
+                        # re-use a left behind X-server instance of a previous/crashed run of Python X2Go Client
+                        os.environ.update({'DISPLAY': p_xs[1]['display']})
+                    else:
+                        # presume the running XServer listens on :0
+                        os.environ.update({'DISPLAY': 'localhost:0'})
 
         if _X2GOCLIENT_OS == 'Windows' and start_pulseaudio:
             self.pulseaudio = X2goPulseAudio(path=self.pulseaudio_installdir, client_instance=self, logger=self.logger)
diff --git a/x2go/xserver.py b/x2go/xserver.py
index 0ed3476..b2b5a37 100644
--- a/x2go/xserver.py
+++ b/x2go/xserver.py
@@ -178,7 +178,7 @@ class X2goClientXConfig(inifiles.X2goIniFile):
         Renders a list of preferred XServer names (most preferred on top).
 
         """
-        if self.xserver_launch_possible and self.xserver_launch_needed:
+        if self.xserver_launch_possible:
             return (self.installed_xservers[0], self.get_xserver_config(self.installed_xservers[0]))
         else:
             return None


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