Pass a window ID into kwallet, so it can attach itself to the xterm.
Patch by peters, with reference to Arfrever's much more complicated
effort in trunk.


--- a/subversion/libsvn_auth_kwallet/kwallet.cpp
+++ b/subversion/libsvn_auth_kwallet/kwallet.cpp
@@ -22,6 +22,7 @@
 
 /*** Includes. ***/
 
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -114,8 +115,14 @@
                                  "kwallet-opening-failed",
                                  APR_HASH_KEY_STRING))
     {
+      long wid = 0;
+      const char *wid_env_string = getenv("WINDOWID");
+      if (wid_env_string)
+        {
+          wid = atol(wid_env_string);
+        }
       wallet = KWallet::Wallet::openWallet(wallet_name,
-                                           -1,
+                                           wid ? wid : 1,
                                            KWallet::Wallet::Synchronous);
     }
   if (wallet)
