PATCH: kwallet lockup (#65978/#71048)

Lubos Lunak l.lunak at suse.cz
Thu Jan 8 13:52:48 GMT 2004


 Hello,

 compile and run the attached testapp. And make sure you have option 
AllowDeactivateGrabs in XF86Config, 'sleep 20;killall a.out' or similar 
ready, or you'll have to use Ctrl+Alt+Backspace. #65978 has a good analysis 
of the problem, let's go to the solution:

 In order to be able to release the popup grab, the app talking to the wallet 
mustn't block in the DCOP call, but must reenter the event loop 
(kwallet.cc.patch). I hope the patch lists all cases where the problem can 
arise, but I'm not sure. Since closing of the popup is done as handling of 
the input events, but KApplication blocks all user input while waiting for 
DCOP calls, it needs to be patched to do that directly 
(kapplication.cpp.patch). Moreover, patching Qt is also recommended 
(qapplication_x11.cpp.patch), otherwise if the first mouse event doesn't 
result in closing the popup, the mouse will stay frozen.

 Please review. The somewhat problematic part with this is that I made the 
code cancel the popup only after clicking outside of it, or pressing Esc, as 
I don't think any random input while waiting for DCOP calls should cancel any 
possibly open popups. However, if you get the kwallet dialog, it's a bit odd 
that you have first click on it or press Esc in order to work with it, 
especially if the kwallet dialog gets placed so that it's not obvious it's 
under the popup.


 BTW, I think that there can be still possibly some problems with kwallet in 
kded, as it reenters the enter loop when it shows the dialogs. If, while kded 
is recursed in the event loop and waiting for the dialog to be handled, some 
other request comes, possibly again reentering the event loop, the calls may 
get intermixed, with who knows what results. I think code in kded, when it 
needs a dialog, should only show it, setup signals, return to the event loop, 
and continue after it gets signal about the dialog being handled.


-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.cpp
Type: text/x-c++src
Size: 1962 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040108/353b726d/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kwallet.cc.patch
Type: text/x-diff
Size: 1054 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040108/353b726d/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kapplication.cpp.patch
Type: text/x-diff
Size: 1430 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040108/353b726d/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qapplication_x11.cpp.patch
Type: text/x-diff
Size: 660 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040108/353b726d/attachment-0002.patch>


More information about the kde-core-devel mailing list