[X2go-Commits] x2goclient.git - master (branch) updated: 3.99.1.0-14-g3b20e0e

X2go dev team git-admin at x2go.org
Wed Feb 29 16:53:24 CET 2012


The branch, master has been updated
       via  3b20e0e71cf3c01b1f73ecee2014c4ddf5c07a3f (commit)
       via  93d11591928f54ff28a06edd10cb13494ef10d41 (commit)
      from  db39c41e27721872a3c235298c42c41d202d35b6 (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 3b20e0e71cf3c01b1f73ecee2014c4ddf5c07a3f
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Feb 29 16:53:01 2012 +0100

    On Mac OS X connect to Xserver via Unix file socket.

commit 93d11591928f54ff28a06edd10cb13494ef10d41
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Feb 29 16:46:49 2012 +0100

    fix copyright headers

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

Summary of changes:
 debian/changelog       |    1 +
 onmainwindow.cpp       |    8 ++--
 onmainwindow_part3.cpp |   72 ++++++++++++-----------------------------------
 onmainwindow_privat.h  |    6 ++--
 4 files changed, 27 insertions(+), 60 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index cbdbd57..534c2d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,7 @@ x2goclient (3.99.1.1-0~x2go1) UNRELEASED; urgency=low
     - The default of a 10 seconds SSH connection timeout is pretty low,
       especially when using tcp_wrappers with the identd option turned on.
       Wait for a 60 seconds timeout.
+    - On Mac OS X connect to Xserver via Unix file socket.
 
   [ Daniel Lindgren ]
   * New upstream version (3.99.1.1):
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 344c993..904ab79 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -1,9 +1,9 @@
-/***************************************************************************
-*   Copyright (C) 2005-2012 by Oleksandr Shneyder   *
-*   oleksandr.shneyder at obviously-nice.de   *
+***************************************************************************/
+*   Copyright (C) 2005-2012 by Oleksandr Shneyder                         *
+*   oleksandr.shneyder at obviously-nice.de                                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License as published by  F*
+*   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
diff --git a/onmainwindow_part3.cpp b/onmainwindow_part3.cpp
index fb6a3ba..363eecc 100644
--- a/onmainwindow_part3.cpp
+++ b/onmainwindow_part3.cpp
@@ -1,9 +1,9 @@
-/***************************************************************************
-*   Copyright (C) 2005-2012 by Oleksandr Shneyder   *
-*   oleksandr.shneyder at obviously-nice.de   *
+***************************************************************************/
+*   Copyright (C) 2005-2012 by Oleksandr Shneyder                         *
+*   oleksandr.shneyder at obviously-nice.de                                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License as published by  F*
+*   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
@@ -2054,63 +2054,29 @@ bool ONMainWindow::checkAgentProcess()
 #if defined ( Q_OS_DARWIN )
 QString ONMainWindow::getXDisplay()
 {
-    QTcpSocket tcpSocket ( this );
-    uint dispNumber=0;
-    QString xname,xdir,xopt;
-    dispNumber=0;
-    xdir=ConfigDialog::getXDarwinDirectory();
-    xname=xdir+"/Contents/MacOS/X11";
-    xopt=" -rootless :0";
-
-    //for newer versions of XQuartz start startx instead of X11.app
-    xname="/usr/X11/bin/startx";
-    xopt="";
-    tcpSocket.connectToHost ( "127.0.0.1",6000+dispNumber );
+    QLocalSocket unixSocket (this);
+    QString xsocket (getenv ("DISPLAY"));
 
-    if ( tcpSocket.waitForConnected ( 3000 ) )
-    {
-        tcpSocket.close();
-        return QString::number ( dispNumber );
-    }
-    if ( xname==QString::null )
-    {
-        QMessageBox::critical (
-            this,tr ( "Can't connect to X-Server" ),
-            tr (
-                "Can't connect to X-Server\nPlease check your settings"
-            ) );
-        slotConfig();
-        return QString::null;
-    }
-    QProcess* pr=new QProcess ( this );
-    pr->setWorkingDirectory ( xdir );
-    pr->start ( xname+" "+xopt,QIODevice::NotOpen );
-    if ( pr->waitForStarted ( 3000 ) )
+    // OS X starts the X11 server automatically, as soon as the launchd UNIX socket
+    // is accessed.
+    // On user login, the DISPLAY environment variable is set to this said existing
+    // socket.
+    // By now, we should have a socket. Test, if connecting works.
+    if ((!xsocket.isEmpty ()))
     {
-#ifdef Q_OS_DARWIN
-        //FIXME: the call of unistd.h sleep() do not work on all
-        // Mac OS X systems
-        system ( "sleep 3" );
-#endif
+        unixSocket.connectToServer (xsocket);
 
-        tcpSocket.connectToHost ( "127.0.0.1",6000+dispNumber );
-        if ( tcpSocket.waitForConnected ( 1000 ) )
+        if (unixSocket.waitForConnected (10000))
         {
-            tcpSocket.close();
-            return QString::number ( dispNumber );
+            unixSocket.disconnectFromServer ();
+            return (xsocket);
         }
-        QMessageBox::critical (
-            this,tr ( "Can't connect to X-Server" ),
-            tr (
-                "Can't connect to X-Server\nPlease check your settings"
-            ) );
-        slotConfig();
-        return QString::null;
     }
+    // And if not, error out.
     QMessageBox::critical (
-        this,QString::null,
+        this,tr ( "Can't connect to X server\nPlease check your settings" ),
         tr (
-            "Can't start X Server\nPlease check your settings" ) );
+            "Can't start X server\nPlease check your settings" ) );
     slotConfig();
     return QString::null;
 }
diff --git a/onmainwindow_privat.h b/onmainwindow_privat.h
index 9e4375a..aa049f7 100644
--- a/onmainwindow_privat.h
+++ b/onmainwindow_privat.h
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2005-2012 by Oleksandr Shneyder   *
- *   oleksandr.shneyder at obviously-nice.de   *
+ *   Copyright (C) 2005-2012 by Oleksandr Shneyder                         *
+ *   oleksandr.shneyder at obviously-nice.de                                  *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -66,7 +66,7 @@
 #include <QFileDialog>
 #include <QHttp>
 #include <QUrl>
-#include <QTcpSocket>
+#include <QLocalSocket>
 #include <QPlastiqueStyle>
 #include "sshprocess.h"
 #include "imgframe.h"


hooks/post-receive
-- 
x2goclient.git (X2Go Client)

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 "x2goclient.git" (X2Go Client).




More information about the x2go-commits mailing list