[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.1.1.4-87-g1ea418b

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


The branch, build-baikal has been updated
       via  1ea418ba168848ba287621c5ee27459ae2b4da63 (commit)
      from  39e5ef4fd88ebd1b076aa85ccf23ba3e7c0a9dd9 (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:
 x2go/utils.py |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 53 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/x2go/utils.py b/x2go/utils.py
index 3c042c7..dc74c57 100644
--- a/x2go/utils.py
+++ b/x2go/utils.py
@@ -470,7 +470,31 @@ def is_color_depth_ok(depth_session, depth_local):
     return False
 
 def set_session_window_title(session_name, title, timeout=0):
+    """\
+    Modify a session window title. The current window title has to contain
+    the X2Go session ID to be identifiable.
+
+    @param session_name: session name/ID of an X2Go session window
+    @type session_name: C{str}
+    @param title: the new session window title to be set
+    @type title: C{str}
+    @param timeout: try the title renaming for <timeout> sec at maximum
+    @type timeout: C{int}
+
+    """
+    # establish connection to the win API in use...
+    if _X2GOCLIENT_OS != 'Windows':
+
+        display = Xlib.display.Display()
+        root = display.screen().root
 
+    else:
+
+        # no MS Windows support yet
+        pass
+
+    # search for the window of our focus, do this in a loop till the window as been found
+    # or timeout forces us to give up...
     timeout += 1
     while timeout:
 
@@ -479,9 +503,6 @@ def set_session_window_title(session_name, title, timeout=0):
 
         if _X2GOCLIENT_OS != 'Windows':
 
-            display = Xlib.display.Display()
-            root = display.screen().root
-
             windowIDs = root.get_full_property(display.intern_atom('_NET_CLIENT_LIST'), Xlib.X.AnyPropertyType).value
             for windowID in windowIDs:
                 window = display.create_resource_object('window', windowID)
@@ -492,13 +513,38 @@ def set_session_window_title(session_name, title, timeout=0):
                     display.sync()
                     break
 
+        else:
+            # no MS Windows support yet
+            pass
+
         if success:
             break
 
         gevent.sleep(1)
 
 def raise_session_window(session_name, timeout=0):
+    """\
+    Bring a session window to foreground.
+
+    @param session_name: session name/ID of an X2Go session window
+    @type session_name: C{str}
+    @param timeout: try the title renaming for <timeout> sec at maximum
+    @type timeout: C{int}
+
+    """
+    # establish connection to the win API in use...
+    if _X2GOCLIENT_OS != 'Windows':
+
+        display = Xlib.display.Display()
+        root = display.screen().root
 
+    else:
+
+        # no MS Windows support yet
+        pass
+
+    # search for the window of our focus, do this in a loop till the window as been found
+    # or timeout forces us to give up...
     timeout += 1
     while timeout:
 
@@ -507,9 +553,6 @@ def raise_session_window(session_name, timeout=0):
 
         if _X2GOCLIENT_OS != 'Windows':
 
-            display = Xlib.display.Display()
-            root = display.screen().root
-
             windowIDs = root.get_full_property(display.intern_atom('_NET_CLIENT_LIST'), Xlib.X.AnyPropertyType).value
             for windowID in windowIDs:
                 window = display.create_resource_object('window', windowID)
@@ -521,6 +564,10 @@ def raise_session_window(session_name, timeout=0):
                     display.sync()
                     break
 
+        else:
+            # no MS Windows support yet
+            pass
+
         if success:
             break
 


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