Bug 167955

Summary: Can not exit krfb
Product: [Applications] krfb Reporter: Ronny Standtke <Ronny.Standtke>
Component: generalAssignee: Alessandro Praduroux <pradu>
Status: RESOLVED FIXED    
Severity: normal CC: mail, miwi
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ronny Standtke 2008-08-01 10:06:21 UTC
Version:            (using KDE 4.1.0)
Installed from:    Ubuntu Packages

When krfb sits in the systray and I select "Quit" in the right mouse button menu, a small window pops up for a tenth of a second and just disappears. Krfb just keeps on running. It is not possible to exit krfb this way.
Comment 1 Martin Wilke 2008-08-04 12:49:38 UTC
I can confim this problem with qt 4.4.1 and 4.1 under FreeBSD.
Comment 2 Ronny Standtke 2008-08-04 13:46:40 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 George Kiagiadakis 2008-09-04 15:20:52 UTC
This bug is still present on KDE 4.1.1. I wonder why and how the confirmation dialog closes so quickly.
Comment 4 Terry 2008-10-26 02:14:51 UTC
Also present in KDE 4.1.2 and reported at https://bugs.launchpad.net/ubuntu/+source/kdenetwork/+bug/271928. 

As mentioned in the bug report above, the bug can be reproduced by choosing "Restore", close the window again and then choose "Quit". Starting krfb and choosing "Quit" without any other program interaction behaves normally.

I'm certainly no expert on KDE development but it seems krfb uses standard actions (KStandardActions?) as I can't find anything relating to the actual quit event in the source code, perhaps there is a conflict here? But like I said, I'm far from an expert on C++ let alone KDE development.
Comment 5 George Kiagiadakis 2008-10-28 20:50:26 UTC
The issue seems to be quite complex here... The problem seems to originate on the fact that krfb maintains its own main loop which calls QApplication::processEvents() on every run to ensure that events from the qt event loop are delivered. However, the quit confirmation dialog is a KMessageBox, which in turn runs its own event loop on top of qt's and krfb's main loop doesn't take that into account. As it seems, the code was the same in kde3, but apparently it worked (I didn't test it though!), so the port from qt3 to qt4 might be the cause that revealed this bug. I'll try to think of a workaround...
Comment 6 George Kiagiadakis 2008-10-29 00:58:37 UTC
SVN commit 877254 by gkiagia:

Integrate the rfb event system with qt's event loop instead of running a custom event loop in KrfbServer.
This fixes the major problem that modal dialogs were closing immediately after they were shown,
which caused huge usability issues.
BUG: 167955



 M  +25 -17    krfbserver.cpp  
 M  +2 -2      krfbserver.h  
 M  +1 -4      main.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=877254
Comment 7 George Kiagiadakis 2008-10-29 01:21:33 UTC
SVN commit 877255 by gkiagia:

Backport r877254.
Integrate the rfb event system with qt's event loop instead of running a custom event loop in KrfbServer.
This fixes the major problem that modal dialogs were closing immediately after they were shown,
which caused huge usability issues.
CCBUG: 167955



 M  +25 -17    krfbserver.cpp  
 M  +2 -2      krfbserver.h  
 M  +1 -4      main.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=877255
Comment 8 Terry 2008-10-29 01:50:31 UTC
I've tested your fixes against the Ubuntu sources and I can confirm it is working for me.
Comment 9 George Kiagiadakis 2008-10-29 14:14:04 UTC
*** Bug 167954 has been marked as a duplicate of this bug. ***