[X2Go-Commits] [x2gokdriveclient] 01/01: wait for server version before requesting main image.

git-admin at x2go.org git-admin at x2go.org
Tue Oct 12 16:12:57 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gokdriveclient.

commit f4a5826f622cae7450f8ddb3959c0663c8e896e6
Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
Date:   Tue Oct 12 09:12:48 2021 -0500

    wait for server version before requesting main image.
---
 client.cpp       | 26 ++++++++++++++++++++------
 client.h         |  2 ++
 debian/changelog |  1 +
 menuframe.cpp    |  2 +-
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/client.cpp b/client.cpp
index 9df71f9..eb0c948 100644
--- a/client.cpp
+++ b/client.cpp
@@ -822,6 +822,7 @@ void Client::getServerversion()
     serverExtSelection = (serverVersion>1);
 
     qDebug()<<"server version:"<<serverVersion;
+    initGeometry();
 }
 
 void Client::getClientSelection()
@@ -1348,13 +1349,27 @@ void Client::socketConnected()
 
     connected=true;
 
-    if(geometry().width() != width || geometry().height() != height )
-        resize(width, height);
-     currentGeometry=geometry();
-     sendGeometryEvent();
+    // send client version
+    sendClientVersion();
+    QTimer::singleShot(2000, this, SLOT(checkServerVersion()));
+}
 
-    QTimer::singleShot(2000, this, SLOT(sendClientVersion()));
+void Client::checkServerVersion()
+{
+    if(!serverVersion)
+    {
+        qDebug()<<"Server Version is 0, please update your x2gokdrive package";
+        //if the server bversion is 0, we didn't init the geometry yet
+        initGeometry();
+    }
+}
 
+void Client::initGeometry()
+{
+    if(geometry().width() != width || geometry().height() != height )
+        resize(width, height);
+    currentGeometry=geometry();
+    sendGeometryEvent();
     if(fullscreen)
     {
         QTimer::singleShot(1000, this, SLOT( slotFS()));
@@ -1364,7 +1379,6 @@ void Client::socketConnected()
         QTimer::singleShot(1000, this, SLOT( slotDisplayFS()));
     }
 
-
 }
 
 void Client::socketDisconnected()
diff --git a/client.h b/client.h
index 5adf87d..bb42f5e 100644
--- a/client.h
+++ b/client.h
@@ -205,6 +205,7 @@ private slots:
     void slotResizeFSFinal();
     void slotSelectionChanged(QClipboard::Mode mode);
     void requestCacheRebuild();
+    void checkServerVersion();
 public slots:
     void editWindowTitle();
 
@@ -235,6 +236,7 @@ private:
     void sendGeometryEvent();
     void setFS(int screenNumber);
     void reinitCaches();
+    void initGeometry();
     bool wantRepaint=false;
 #ifndef Q_OS_LINUX
     void sendSelectionToServer(SelectionType selection);
diff --git a/debian/changelog b/debian/changelog
index 4b56a53..cac49e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,5 +33,6 @@ x2gokdriveclient (0.0.0.1-0x2go1) UNRELEASED; urgency=medium
     - use zlib library to decompress compressed strings instead of built in QT function.
     - reiniting of frame and cursors caches if cache is corrupted.
     - support for --debug command line argument.
+    - wait for server version before requesting main image.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Tue, 04 Jun 2019 11:10:43 +0200
diff --git a/menuframe.cpp b/menuframe.cpp
index 7d9bbcc..4db0ffe 100644
--- a/menuframe.cpp
+++ b/menuframe.cpp
@@ -234,7 +234,7 @@ void MenuFrame::adjustPosition()
     int y=0;
     int x=0;
 
-    qDebug()<<"Widget width"<<width();
+//     qDebug()<<"Widget width"<<width();
     switch(orientation)
     {
         case BOTTOM:

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdriveclient.git


More information about the x2go-commits mailing list