Summary: | KDEInit could not launch 'kate' | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Stolz <stolz> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Stolz
2005-12-28 23:23:50 UTC
SVN commit 493097 by alund: Fix instance reuse with klauncher - registering with dcop makes it happy Attempt to show the window when a file is opened with --use. This works if the broken focus stealing prevention is off, otherwise it works if the window is minimized (restore of maximize also raises and focuses). BUG: 119146 M +25 -0 katemain.cpp --- branches/KDE/3.5/kdebase/kate/app/katemain.cpp #493096:493097 @@ -26,6 +26,7 @@ #include <kglobal.h> #include <kconfig.h> #include <kinstance.h> +#include <kstartupinfo.h> #include <dcopclient.h> #include <dcopref.h> #include <kdebug.h> @@ -137,6 +138,8 @@ if (!kateApp.isEmpty()) { kdDebug () << "kate app: " << kateApp << endl; + // make kdeinit happy + client.registerAs( "kate" ); DCOPRef kRef (kateApp, "KateApplication"); @@ -189,6 +192,24 @@ if (nav) kRef.call( "setCursor", line, column ); + // since the user tried to open a document, let us assume [s]he + // wants to see that document. + // ### what to do about the infamous focus stealing prevention? + uint mwn = kRef.call("activeMainWindowNumber"); + QCString smwn; + DCOPRef wRef( kateApp, QCString( "__KateMainWindow#") + smwn.setNum(mwn) ); + if ( wRef.call("minimized") ) + { + if ( wRef.call( "maximized" ) ) + wRef.call( "maximize" ); + else + wRef.call("restore"); + } + wRef.call( "raise" ); + + // stop startup notification + KStartupInfo::appStarted( ); + return 0; } } @@ -198,8 +219,12 @@ // app execution should already end :) if (app.shouldExit()) + { return 0; + } // execute ourself ;) return app.exec(); } + +// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off; JFI: This is not ported from 3.5-branch to trunk, yet. Maybe we should wait for D-Bus first + we don't know whether the problem in trunk exists at all. |