From: Tatsuro M. <tma...@ya...> - 2018-03-10 07:50:57
|
I have tried the patch for qt-5.4.0 in the below thread https://sourceforge.net/p/gnuplot/mailman/message/33212164/ For gnuplot --- old/src/qtterminal/qt_term.cpp 2014-12-30 19:52:59.000000000 +0100 +++ new/src/qtterminal/qt_term.cpp 2015-01-04 01:25:03.219400000 +0100 @@ -273,7 +273,19 @@ // The QLocalSocket::waitForConnected does not respect the time out argument when // the gnuplot_qt application is not yet started or has not yet self-initialized. // To wait for it, we need to implement the timeout ourselves +#ifdef __CYGWIN__ + QDateTime timeout = QDateTime::currentDateTime().addMSecs(5000); + char const * const sockname = + qt->socket.fullServerName().toLocal8Bit().constData(); + do + { + usleep(300000); + + } while(access(sockname, F_OK) != 0 && QDateTime::currentDateTime() < timeout); + timeout = QDateTime::currentDateTime().addMSecs(1000); +#else QDateTime timeout = QDateTime::currentDateTime().addMSecs(30000); +#endif do { qt->socket.connectToServer(server); For qt --- a/qtbase-opensource-src-5.4.0/src/network/socket/qlocalsocket_unix.cpp 2014-12-25 19:48:59.845052000 +0100 +++ b/qtbase-opensource-src-5.4.0/src/network/socket/qlocalsocket_unix.cpp 2014-12-25 18:41:32.359905400 +0100 @@ -240,6 +240,7 @@ void QLocalSocket::connectToServer(OpenM QLatin1String("QLocalSocket::connectToServer")); return; } +#ifndef Q_OS_CYGWIN // set non blocking so we can try to connect and it won't wait int flags = fcntl(d->connectingSocket, F_GETFL, 0); if (-1 == flags @@ -248,6 +249,7 @@ void QLocalSocket::connectToServer(OpenM QLatin1String("QLocalSocket::connectToServer")); return; } +#endif // _q_connectToSocket does the actual connecting d->connectingName = d->serverName; Now Qt version for cygwin is 5.9.4 However, code of corresponding part is changed to // create the socket if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK))) { d->errorOccurred(UnsupportedSocketOperationError, QLatin1String("QLocalSocket::connectToServer")); return; } I commented out the above The result is gnuplot> pl x gnuplot> pl x QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-MATSUOKA LAB' Could not connect to existing gnuplot_qt. Starting a new one. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-MATSUOKA LAB' Warning: slow font initializationgnuplot> But the situation is the same as before modification. Any suggestions? I at the moment use wxt terminal on Cygwin Tatsuro |