Version: (using Devel) Compiler: gcc-4.2.4 OS: Linux Installed from: Compiled sources I have mapped some multimedia keys to high function keys. In one particular case, I have a volume knob that I've set up to deliver an F22 when rotated clockwise, and F21 when rotated counter-clockwise. In the system settings, Global Keyboard Shortcuts, for kmix, I have set "Increase Volume" to F22, and "Decrease Volume" to F21. This works until I log out, after which time the "Increase Volume" setting is cleared. It's always the increase volume. The decrease volume and mute settings persist. Looking at kglobalshortcutsrc, while I'm logged in it has a line that looks like this: increase_volume=F20,Volume Up,Increase Volume After I log out, it looks like this: increase_volume=Volume Up,Volume Up,Increase Volume Those are the only differences inserted into this file during the logout process. This is annoying, as I have to reset the volume-up behaviour by hand every time I log in.
More details, and a minor correction. I drew those kglobalshortcutsrc lines from a different computer, one which had F20 for the volume-up button. On the computer which uses F22 for increase volume, the line naturally shows "F22". I'm using revision 1098335. This is relatively recent breakage, I first noticed it when I recompiled about three weeks ago.
Let's look at the function. In kdemultimedia/kmix/kmix.cpp void KMixWindow::initActionsLate() { if ( m_autouseMultimediaKeys ) { KAction* globalAction = actionCollection()->addAction("increase_volume"); globalAction->setText(i18n("Increase Volume")); globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeUp), ( KAction::ShortcutTypes)( KAction::ActiveShortcut | KAction::DefaultShortcut), KAction::NoAutoloading); connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotIncreaseVolume())); globalAction = actionCollection()->addAction("decrease_volume"); globalAction->setText(i18n("Decrease Volume")); globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeDown)); connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotDecreaseVolume())); globalAction = actionCollection()->addAction("mute"); globalAction->setText(i18n("Mute")); globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeMute)); connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotMute())); } } Why is the setGlobalShortcut() code for "increase_volume" different from that for "decrease_volume" and "mute"? The latter two work correctly, but the first is broken for me.
This patch fixes the behaviour for me: Index: kmix.cpp =================================================================== --- kmix.cpp (revision 1111731) +++ kmix.cpp (working copy) @@ -144,7 +144,8 @@ if ( m_autouseMultimediaKeys ) { KAction* globalAction = actionCollection()->addAction("increase_volume"); globalAction->setText(i18n("Increase Volume")); - globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeUp), ( KAction::ShortcutTypes)( KAction::ActiveShortcut | KAction::DefaultShortcut), KAction::NoAutoloading); +// globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeUp), ( KAction::ShortcutTypes)( KAction::ActiveShortcut | KAction::DefaultShortcut), KAction::NoAutoloading); + globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeUp)); connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotIncreaseVolume())); globalAction = actionCollection()->addAction("decrease_volume");
I can confirm that the volume up shortcut is messed up every time I log into KDE (also using SVN trunk version through openSUSE packages). I've set Meta+Up as a shortcut but after login, 'Volume Up' special key is set instead, which my keyboard is lacking :-) Other KMix shortcuts are unaffected. This happened only recently. Haven't had the time to test the patch though..
SVN commit 1133816 by saschpe: Fix volume up / mute shortcut issue, which overwrites custom shortcuts with system defaults. BUG: 229300 M +1 -1 kmix.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1133816
I'm the original reporter, and I'm marking it as verified. The change is the same as the non-comment part of my patch, which did fix the problem.
Somehow this bug has been reintroduced, and is present in revision 1191299. The suspicious code in comment #2 is back again. The .cpp file has been moved to kdemultimedia/kmix/apps/.
I can confirm that this bug is present again in both 4.5.80 and 4.5.85. The change described in #3 still fixes it. Please fix this again. (Btw, the bug was reintroduced in Revision 1170713 by esken on Sep 1 21:37:18 2010 UTC.)
Can also confirm it. Can someone either revert the commit or re-apply my patch? I'm currently unable to do for myself.
I can confirm this bug since 4.5.80. Unfortunately it's not fixed in RC2. I hope relese will do fine with that.
I just committed Sascha's fix again. Unfortunately automatic updating of this bug failed since I don't have required permissions to mark it closed. Here're the links: trunk: WebSVN link: http://websvn.kde.org/?view=rev&revision=1213537 4.6 branch: WebSVN link: http://websvn.kde.org/?view=rev&revision=1213541
*** Bug 262088 has been marked as a duplicate of this bug. ***
Fixed, according to comment #11
I just found the same bug with another shortcut. The "KDE Deamon -> Sleep" shortcut gets reset too. Should I open a new bug about this?
Never mind, I opened bug 262908 for this.