Problem with applications which have a system tray applet and secondary windows

Ingo Klöcker kloecker at kde.org
Sun Dec 21 16:03:19 GMT 2003


On Sunday 21 December 2003 13:50, David Faure wrote:
> On Sunday 07 December 2003 23:58, Ingo 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.
>
> You're right, there's something missing. I just had a thought about
> this, and: when creating a first new KMainWindow after that "deref"
> call, it should call ref again somehow.
>
> So maybe a simpler way would be that every KMainWindow calls ref in
> its ctor and deref in its dtor. This is much simpler, cleaner, and
> should work, no?

Yes, this is much simpler and much more logical. But as Martijn already 
wrote this will probably break a lot of applications. So I doubt that 
it's feasible to change the current behavior before KDE 4.0.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031221/698e9338/attachment.sig>


More information about the kde-core-devel mailing list