Bug 83231

Summary: keyboard shortcuts don't work with multihead
Product: [Unmaintained] khotkeys Reporter: Florian E.J. Fruth <spammail01>
Component: generalAssignee: Lubos Lunak <l.lunak>
Status: RESOLVED FIXED    
Severity: normal CC: bugzillas, tusimi
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Florian E.J. Fruth 2004-06-11 20:54:35 UTC
Version:           0.5 (using KDE 3.2.3, Gentoo)
Compiler:          gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.6

i can set keyboard shortcuts and use them on my first screen (triple-head setup w/o xinerama). but they don't work on screen 2 or 3. shortcuts set in kcmkeys work fine on all heads.
Comment 1 Lubos Lunak 2004-11-25 19:49:11 UTC
CVS commit by lunakl: 

Run khotkeys per-head, just like other apps.
BUG: 83231


  M +2 -4      app/app.cpp   1.3
  M +3 -2      kcontrol/kcmkhotkeys.cpp   1.35


--- kdebase/khotkeys/app/app.cpp  #1.2:1.3
@@ -95,8 +95,6 @@ int KDE_EXPORT kdemain( int argc, char**
         {
         // multiheaded hotkeys
-        KInstance inst("khotkeys-multihead");
-        KConfig config("kdeglobals", true);
-        config.setGroup("X11");
-        if (config.readBoolEntry("enableMultihead")) {
+        QCString multiHead = getenv("KDE_MULTIHEAD");
+        if (multiHead.lower() == "true") {
             Display *dpy = XOpenDisplay(NULL);
             if (! dpy) {

--- kdebase/khotkeys/kcontrol/kcmkhotkeys.cpp  #1.34:1.35
@@ -18,4 +18,5 @@
 
 #include <unistd.h>
+#include <stdlib.h>
 
 #include <qlayout.h>
@@ -60,9 +61,9 @@ void init_khotkeys()
     if( !cfg.readBoolEntry( "Autostart", false ))
         return;
-    cfg.setGroup("X11"); // from kdeglobals actually
     // Non-xinerama multhead support in KDE is just a hack
     // involving forking apps per-screen. Don't bother with
     // kded modules in such case.
-    if( cfg.readBoolEntry( "enableMultihead" ))
+    QCString multiHead = getenv("KDE_MULTIHEAD");
+    if (multiHead.lower() == "true")
         kapp->kdeinitExec( "khotkeys" );
     else


Comment 2 Lubos Lunak 2004-11-25 19:50:34 UTC
*** Bug 92165 has been marked as a duplicate of this bug. ***
Comment 3 Petteri Räty 2005-03-03 20:33:38 UTC
Is this supposed to work now? I have this problem with 3.4.0_rc1. 
Comment 4 Florian E.J. Fruth 2005-03-17 23:18:50 UTC
works for me with kde-3.4.0 final (gentoo)