[X2Go-Commits] [x2goclient] 01/01: - Set modmap timer timeout to 10 sec on Mac. - Fix running xmodmap if X2Go Client not started from terminal. - Setting keyboard modifiers with xmodmap.

git-admin at x2go.org git-admin at x2go.org
Fri Jan 31 14:54:39 CET 2014


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

x2go pushed a commit to branch master
in repository x2goclient.

commit 71979ab36f6c275bbab178881a4e0ab1769323a3
Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
Date:   Fri Jan 31 14:54:32 2014 +0100

      - Set modmap timer timeout to 10 sec on Mac.
      - Fix running xmodmap if X2Go Client not started from terminal.
      - Setting keyboard modifiers with xmodmap.
---
 debian/changelog |    3 +++
 onmainwindow.cpp |   32 +++++++++++++++++++++++++++++---
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4534fd4..b597a28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ x2goclient (4.0.2.0-0x2go1) UNRELEASED; urgency=low
     - Revrite SSH Classes to support libssh fix.
     - Add Class HelpDialog to show options in scroll area. 
     - Fix authentication on SSH Broker with key + passphrase.
+    - Set modmap timer timeout to 10 sec on Mac.
+    - Fix running xmodmap if X2Go Client not started from terminal.
+    - Setting keyboard modifiers with xmodmap.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 22 Jan 2014 09:20:08 +0100
 
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 3e50ad9..fd19e32 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -5477,11 +5477,36 @@ void ONMainWindow::slotSetModMap()
     }
     if(kbMap.length()<=0)
     {
-        x2goDebug<<"get keyboard map";
         QProcess pr(this);
-        pr.start("xmodmap -pke");
+        pr.setProcessEnvironment(QProcessEnvironment::systemEnvironment());
+        pr.start("/opt/X11/bin/xmodmap -pke");
         pr.waitForFinished();
         kbMap=pr.readAllStandardOutput();
+        pr.start("/opt/X11/bin/xmodmap -pm");
+        pr.waitForFinished();
+        QString modifiers=pr.readAllStandardOutput();
+        x2goDebug<<"modifiers: "<<modifiers;
+        kbMap+="clear shift\nclear lock\nclear control\nclear mod1\nclear mod2\nclear mod3\nclear mod4\nclear mod5\n";
+        QStringList lines=modifiers.split("\n",QString::SkipEmptyParts);
+        for(int i=0; i<lines.count(); ++i)
+        {
+            QStringList parts=lines[i].split(" ",QString::SkipEmptyParts);
+            if(parts.count()<2)
+            {
+                continue;
+            }
+            QString mod=parts[0];
+            if(mod == "shift" || mod=="lock" || mod=="control" || mod=="mod1"|| mod=="mod2"|| mod=="mod3"|| mod=="mod4"|| mod=="mod5")
+            {
+                for(int j=1; j<parts.count(); ++j)
+                {
+                    if(parts[j].indexOf("(")==-1)
+                    {
+                        kbMap+="add "+mod+" = "+parts[j]+"\n";
+                    }
+                }
+            }
+        }
     }
     if(sshConnection->useKerberos())
     {
@@ -5754,7 +5779,7 @@ void ONMainWindow::slotProxyStderr()
 #ifdef Q_OS_DARWIN
         modMapTimer=new QTimer(this);
         connect(modMapTimer, SIGNAL(timeout()), this, SLOT (slotSetModMap()));
-        modMapTimer->start(30000);
+        modMapTimer->start(10000);
         slotSetModMap();
 #endif
         if ( newSession )
@@ -11491,6 +11516,7 @@ long ONMainWindow::findWindow ( QString text )
 #ifdef Q_OS_WIN
     return ( long ) wapiFindWindow ( 0,text.utf16() );
 #endif
+    return 0;
 }
 
 //////////////////////////plugin stuff//////////////

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git



More information about the x2go-commits mailing list