Bug 131756

Summary: kwallet password dialog does not get focus when sending mail
Product: [Unmaintained] kmail Reporter: p <peter.mueller_1955>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: dima, l.lunak
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: xprop and xwininfo of kwallet-dialog and kmail

Description p 2006-08-03 04:40:57 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs

1. open kmail
2. do NOT download emails
3. write an email
4. press send
5. the wallet password dilog comes up but you have to click into the window to type. Would be VERY convenient if the focus is on that window.
Comment 1 Stefan Gehn 2006-08-03 09:06:39 UTC
I think that's a drawback of the focus policy in kwin. It tries to keep other apps from grabbing focus, unfortunately kwallet dialogs seem to be "another application" (is kwallet a kded plugin?). I think this has to be special-cased in kwin :(
Comment 2 Ingo Klöcker 2006-08-03 09:59:20 UTC
I think it's possible to circumvent the focus stealing prevention by passing some window id to kwallet (?). Let's ask Lubos.
Comment 3 Lubos Lunak 2006-08-03 11:13:54 UTC
I cannot reproduce the problem, what should I see? Here after sending the mail the composer window closes, kmail needs a password in order to store it using imap and the kwallet dialog shows properly over the main kmail window.
Comment 4 Stefan Gehn 2006-08-03 11:28:04 UTC
Here kwallet dialogs never gets focus AFAICS.
I can also reproduce it just by starting kontact (it asks for the imap password on start because kmail is connecting to my imap server at startup).
Comment 5 Lubos Lunak 2006-08-03 11:41:52 UTC
Works fine for me. Please attach xwininfo and xprop output for all the relevant windows.
Comment 6 Stefan Gehn 2006-08-03 12:39:59 UTC
Created attachment 17212 [details]
xprop and xwininfo of kwallet-dialog and kmail

kmail NET ICON property was stripped, I doubt it's needed.
This is on a Xinerama setup, just in case it makes a difference.
Comment 7 Stefan Gehn 2006-08-03 13:37:03 UTC
Ok, my problem is actually unrelated/different to this bugreport.

Here the kwallet dialog does get proper focus when kmail window is on screen, i.e. I cannot reproduce this exact bug.
Comment 8 p 2006-08-03 17:00:37 UTC
I'm confused. Is Stefan's attachement sufficient for you? If not please advise how to create this xwininfo and xprop output, it doesn't mean anything to me as a non-developer.

Regarding reproducing the problem it is important not to fetch any mails before sending an email. For fetching an email the password dialog has the focus.
Comment 9 Ingo Klöcker 2006-08-03 21:01:06 UTC
Run xwininfo and xprop e.g. in Konsole. After starting each of them click on the two windows.
Comment 10 Bram Schoenmakers 2006-10-06 18:14:56 UTC
*** Bug 135128 has been marked as a duplicate of this bug. ***
Comment 11 Volker Krause 2006-10-09 17:53:23 UTC
SVN commit 593938 by vkrause:

Try harder to find an appropriate parent for the kwallet password
dialog.

Based on a suggestion of Lubos, should fix #133861 and might also help
with #131756.

BUG: 133861
CCBUG: 131756


 M  +8 -2      kmkernel.cpp  


--- branches/KDE/3.5/kdepim/kmail/kmkernel.cpp #593937:593938
@@ -2247,9 +2247,15 @@
   if ( !Wallet::isEnabled() || walletOpenFailed )
     return 0;
 
+  // find an appropriate parent window for the wallet dialog
+  WId window = 0;
+  if ( qApp->activeWindow() )
+    window = qApp->activeWindow()->winId();
+  else if ( getKMMainWidget() )
+    window = getKMMainWidget()->topLevelWidget()->winId();
+
   delete mWallet;
-  mWallet = Wallet::openWallet( Wallet::NetworkWallet(),
-        getKMMainWidget() ? getKMMainWidget()->topLevelWidget()->winId() : 0 );
+  mWallet = Wallet::openWallet( Wallet::NetworkWallet(), window );
 
   if ( !mWallet ) {
     walletOpenFailed = true;
Comment 12 Thomas McGuire 2007-06-11 22:21:55 UTC

*** This bug has been marked as a duplicate of 106459 ***