On Sun, 7 Dec 2003, Ingo [iso-8859-1] Klöcker wrote: > > Why not simply call kapp->ref() from the systemtray (your derived > > class for now, the base one in kde-4 maybe), and deref in the dtor? > > > > Then the user has to close the systray thingie by whichever way, > > before the process exits. > > Hah! I'm glad I'm not the only one that makes this mistake. That's what > I tried first after I found out about kapp->ref(). But it doesn't work. > Now, think again and tell me why it won't work. ;-) > > Hint: kapp->deref() is called each time a last visible window is closed. > And you can close a last visible window more than once. We had similar issues in Kopete, but there we solved it by not closing the main window at all and instead _hiding_ it. What also may or may not help is fiddling with WDestructiveClose. IIRC the deref is used only for destructively closed windows. -- Martijn