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

Cornelius Schumacher schumacher at kde.org
Wed Oct 29 20:04:05 GMT 2003


On Wednesday 29 October 2003 17:29, Lubos Lunak wrote:
> On Wednesday 29 of October 2003 15:57, Cornelius Schumacher wrote:
> >
> > 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.

Let's make an example to make this clearer:

KOrganizer is opened with two main windows, one showing calendar file 
one.ics the other the file two.ics. Now I type "korganizer two.ics" 
into konsole. At this time the konsole window is the active one. As 
result of the command the mainwindow showing file two.ics should be 
brought to front and being activated. No new window should be created. 
Don't I need setActiveWindow() for this?

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

I read the docs of KStartupInfo, but I didn't understand how it would 
apply to this problem. We don't want to startup anything, just activate 
an existing window.

-- 
Cornelius Schumacher <schumacher at kde.org>




More information about the kde-core-devel mailing list