From 94368f4722fa8eae1f7e7cd4b02679a760b0d620 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 19 Sep 2024 17:48:43 +0900 Subject: Various fixes for khotkeys. This resolves issue #326. 1. ensure there is a single khotkeys instance running per session instead of per screen (remote multihead related code) 2. allow khotkeys to be run as a kded module 3. make sure that khotkeys run either as a standalone application or as a kded module, but not both at the same time 4. do not register khotkeys as a main DCOP entry (like an app) anymore. When run as kded module, this was causing kded to be registered as khotkeys a second time. Signed-off-by: Michele Calgaro --- khotkeys/kcontrol/init.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'khotkeys/kcontrol/init.cpp') diff --git a/khotkeys/kcontrol/init.cpp b/khotkeys/kcontrol/init.cpp index 14a9c964b..62abad638 100644 --- a/khotkeys/kcontrol/init.cpp +++ b/khotkeys/kcontrol/init.cpp @@ -24,24 +24,17 @@ extern "C" { TDE_EXPORT void init_khotkeys() { - TDEConfig cfg( "khotkeysrc", true ); - cfg.setGroup( "Main" ); - if( !cfg.readBoolEntry( "Autostart", false )) - return; - // Non-xinerama multhead support in KDE is just a hack - // involving forking apps per-screen. Don't bother with - // kded modules in such case. - TQCString multiHead = getenv("TDE_MULTIHEAD"); - if (multiHead.lower() == "true") - kapp->tdeinitExec( "khotkeys" ); - else - { - DCOPRef ref( "kded", "kded" ); - if( !ref.call( "loadModule", TQCString( "khotkeys" ))) - { - kdWarning( 1217 ) << "Loading of khotkeys module failed." << endl; - kapp->tdeinitExec( "khotkeys" ); - } - } + TDEConfig cfg( "khotkeysrc", true ); + cfg.setGroup( "Main" ); + if( !cfg.readBoolEntry( "Autostart", false )) + { + return; + } + DCOPRef ref( "kded", "kded" ); + if( !ref.call( "loadModule", TQCString( "khotkeys" ))) + { + kdWarning( 1217 ) << "Loading of khotkeys module failed." << endl; + kapp->tdeinitExec( "khotkeys" ); + } } } -- cgit v1.2.1