Wrong (?) usage of deprecated and usage of setActiveWindow vs. activateWindow (was: Re: kdelibs/kdecore)

Lubos Lunak l.lunak at suse.cz
Wed Oct 29 16:29:13 GMT 2003


On Wednesday 29 of October 2003 15:57, Cornelius Schumacher wrote:
> On Wednesday 29 October 2003 15:27, Lubos Lunak wrote:
> >  I cannot put the whole explanation in kwin.h, it's way too long. But I
> > guess I could at least mention it.
>
> You could make the README a README.dox, do some Doxygen markup and
> reference it from the header file API docs. This way it will appear in the
> generated API docs, but you don't have to include it in the header file.

 I can give this a try somewhen.

>
> >  It does. If the application is the active one, setActiveWindow() and
> > activateWindow() are really the same. But if not, then setActiveWindow()
> > will activate the window anyway, while activateWindow() will not. That's
> > why the sooner one is for pagers etc., which indeed should always do
> > that, while activateWindow() is for the latter, because applications
> > should not get activated whenever they feel like they should. E.g. if you
> > decided KMail should activate its main window after every new mail check
> > if there's new mail, you'd get a lot of hate mails from people using
> > periodic mail check if you used setActiveWindow(), while with
> > activateWindow() KWin would step in and refuse activation.
>
> In KOrganizer we use setActiveWindow() when starting KOrganizer from the
> command line with a file name as argument. If a KOrganizer main window
> viewing the given file is already present, we activate it. In this case we
> don't have an active KOrganizer window yet.

 This description looks a bit confusing to me.

> How can activateWindow work
> here? We do need setActiveWindow() instead, don't we?

 If the result of starting an application is creating a new window, doing 
nothing should be enough, KApplication or KUniqueApplication should take care 
of handling all the needed activation and startup notification stuff.
 If the result of starting an application is reusing an existing window, you 
should use KStartupInfo::setNewStartupId(), and pass the startup 
identification to it (KApplication::startupId() will give you that).
 If it's unrelated to starting applications, activateWindow() should be 
usually right.

-- 
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/





More information about the kde-core-devel mailing list