How fire up and raise an application via dcop?

Karl-Heinz Zimmer khz at kde.org
Tue Oct 15 18:44:27 BST 2002


Hi Matthias,

the following is what I tried to start an app (kdaddressbook) via dcop
_and_ 'raise' it to make it the top most widget on screen:


  if( 0 < KApplication::startServiceByDesktopName("kaddressbook") ){
    if( kapp->dcopClient()->isApplicationRegistered("kaddressbook") ){
      QByteArray data, replyData;
      QCString replyType;
      kapp->dcopClient()->call("kdaddressbook",
                               "kaddressbook-mainwindow#1","raise()",
                               data, replyType, replyData );
    }
  }


This does not work if I already /had/ the application visible but
then closed it.
Calling the above code again will then start the app but show
it _below_ the app that I have been looking at before.

Any idea what I might be doing wrong?

TIA
Karl-Heinz
-- 
Karl-Heinz Zimmer, Senior Software Engineer, Klarälvdalens Datakonsult AB
<mailto:khz at klaralvdalens-datakonsult.se>            <mailto:khz at kde.org>





More information about the kde-core-devel mailing list