From kde-core-devel Mon Dec 08 11:56:14 2003 From: Martijn Klingens Date: Mon, 08 Dec 2003 11:56:14 +0000 To: kde-core-devel Subject: Re: Problem with applications which have a system tray applet and X-MARC-Message: https://marc.info/?l=kde-core-devel&m=107088467408644 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