Bug 375555 - Opening KDE apps gives multiples notifications about: "There are two actions(...) that want to use the same shortcut"
Summary: Opening KDE apps gives multiples notifications about: "There are two actions(...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kxmlgui
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 353695 376994 383268 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-25 16:49 UTC by Petros
Modified: 2017-08-30 11:18 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Broken kdeglobals with duplicate shortcuts (6.95 KB, application/x-trash)
2017-03-04 11:15 UTC, Mav
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petros 2017-01-25 16:49:24 UTC
I a gentoo/linux user and since I updated kde-frameworks/ packages to 5.30 I constantly get multiple times these notifications each and every time I try to launch a KDE application. It pop's up a notification for every single menu and action there is in the application, before the actual window show up.

https://s29.postimg.org/tf88plqif/Screenshot_20170125_183424.png

"There are two actions (What's This?, What's this?) that want to use the same shortcut (Shift+F1). This is most probably a bug. Please report it in bugs.kde.org"

If I check "Do not show this message again" for every action, next time I will launch the same app it will show up with a slight delay, but without any notification.
Comment 1 David Edmundson 2017-01-25 20:03:46 UTC
Cause will be this: https://git.reviewboard.kde.org/r/129299/

Hopefully reading that that will confirm if your bug is genuine or not.
Comment 2 Christoph Feck 2017-01-25 21:44:39 UTC
If this happens with all actions (and all applications), then there is some path doubled?
Comment 3 Christoph Feck 2017-02-06 19:38:35 UTC
Confirmed by using

XDG_DATA_DIRS=/usr/share:/usr/share
Comment 4 Christoph Feck 2017-02-06 19:53:23 UTC
Unless the distribution correctly sets paths, it could be caused by startkde/startplasmacompositor scripts:

XDG_DATA_DIRS="@CMAKE_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@:/usr/share:/usr/local/share

XDG_DATA_DIRS="@KDE_INSTALL_FULL_DATADIR@:/usr/share:/usr/local/share

No check is being made if the variables are (or contain) "/usr/share" or "/usr/local/share".
Comment 5 Christoph Feck 2017-02-06 21:15:25 UTC
Actually comment #3 might be wrong. The path that is used to read the standard action shortcuts is not read from XDG_DATA_DIRS. I got confused from a reply on IRC.
Comment 6 Albert Astals Cid 2017-02-06 21:37:29 UTC
Petros, anything special about your setup? You say *all* applications, can you name one to make sure I'm trying one that fails for you.

I can not reproduce this problem at all, hence can't fix it.
Comment 7 Craig 2017-02-06 21:51:03 UTC
Same issue here since updating to the latest on Arch linux x64, it was either plasma 5.9 or the last applications update (not sure which exactly). But almost every KDE app does this. Dolphin, Konversation, KRDC, Kate, etc. all somehow got the "Alternative" keyboard shortcut duplicated from the default/primary shortcut on anywhere from 5-15 shortcuts per app - usually the most common ie Cut, Paste, Delete, but also ones like the Dolphin Handbook, etc. 

I confirmed XDG_DATA_DIRS has /usr/share duplicated, that seems to be a separate bug in /usr/bin/startkde script which has usr/share twice, but after fixing that and restarting the duplicate shortcuts continued. Hitting defaults and reset does not have any effect. Any ideas? This also happened in the past on updates but only ever noticed it on Kate, though this time it seems to be every KDE app I've tried.
Comment 8 Craig 2017-02-06 21:53:23 UTC
Further info: Plasma 5.9.0-1, KDE Apps 16.12.1-1 all the latest on Arch Linux. Also worth mentioning nothing special on my setup at least, though I have had this install for a while (maybe 2+ years). Also occurred on my desktop which has been running the same install for about the same time roughly - driving me crazy. Any way to force reset all shortcuts?
Comment 9 Albert Astals Cid 2017-02-06 22:07:54 UTC
Using archlinux i can't see the problem.

So if you go to Settings->Configure Shortcuts in one of the apps that complains about this, do you actually have the shortcuts duplicated?
Comment 10 Craig 2017-02-09 08:03:15 UTC
Yea very weird, it's obviously not affecting everyone but definitely a subset of people as have heard it discussed in the IRC and no one has found or provided a solution that i've seen - still driving me NUTS and getting to the point of formatting KDE and starting to scratch but really hoping to put that off for a month or two when redo my system anyway.

So as mentioned /usr/share being duplicated in startkde didn't help as I'd hope, but to answer your question upon going to Settings -> Configure Shortcuts in ANY KDE App (as it literally effects them ALL, kalarm, etc.) yes it shows the "Shortcut" AND "Alternative" being the same, both being set to Ctrl+S for save for example. But also worth noting that's not even always the case, sometimes it shows different shortcuts for each ie Ctrl+= and Ctrl++ for a shortcut but it's complaining that's ambiguous, but MOST cases at least with the most common shortcuts they're identical Shortcut/Alternative shortcut and I have to fuss with.

Kate I just opened and first had to hit OK about 15 times to get the app to open, while some of these I'm sure are from way back and just more apparent because the added notification dialog, I do know some just happened in the past week ie those on Dolphin for CUT Ctrl+X as I use that daily and all of a sudden it was ambiguous.

So for an example, back to Kate, once I get past the flurry of ambiguous dialogs I open the Settings -> Configure Shortcut and...
http://i.imgur.com/Vz3jeUf.png

The alternative shortcut is somehow set to "Custom" on a duplicate of the primary. I change it to Default:None and that shortcut is all clear now. Though also worth noting as mentioned that's not always the case, sometimes I really have to fight with it ie change both to None then re-do the primary sort of thing, though that seems to be more rare. Any info I can help to provide? Where exactly are all these shortcuts saved? I don't see any under .config/*shotcut* or *hotkey* etc and also tried checking the specific app rc files to no avail.
Comment 11 Craig 2017-02-09 08:10:14 UTC
Added detail on that other case for an example: for Dolphin, I've mostly re-set all these because obviously I use that constantly but was still complaining about Home and What's this. I look at Configure -> Shortcuts and Home is defined as "Alt+Home" and Alternative being "Home page" but it's complaining that's ambiguous on the start dialogs when opening dolphin. I have to change the alternative to Custom:none and then that ones no longer ambiguous.

What's this which it's still complaining about shows Shortcut being Shift+F1 and Alternative as blank, so why that's thinking it's ambiguous at starting dolphin I do not know, even though it's specifically saying "There are two actions (What's This?, What's This?) that want to use the same shortcut (Shift+F1)" - but again Alternative isn't set at all. I click on the primary shortcut, change it to Custom:None - "Shift+F1" suddenly shifts to the "Alternative" then I re-set the primary shortcut to Default: Shift+F1 and click "Re-assign" when it complains about already being set, that resolves it and I can once again open Dolphin without the notifications.

Problem is having to do this for anywhere from 5-15-20 shortcuts per KDE app is killing me haha, obviously some quirky bug but hoping to find a solution to wipe all the shortcuts or something to default. I've also tried going to System Settings -> Shortcuts and resetting the global shortcuts/etc but of course that doesn't seem to effect the per app ones unfortunately beyond things like Kwin/etc.
Comment 12 Albert Astals Cid 2017-02-09 22:40:50 UTC
Isn't the "don't warn me about this again" checkbox working for you?


You can find the kate shorcuts defined in 
$HOME/.local/share/kxmlgui5/kate/kateui.rc

e.g. i have

  <Action name="file_save_all" shortcut="Ctrl+L; Ctrl+Alt+Shift+L"/>

Do you have the shortcuts duplicated there?

Can you check if maybe you have some other stray kateui.rc file somewhere in your hardisk? For that do
  strace kate &> Q
then close kate
and then
  grep kateui.rc Q | grep "= 0"
and attach the results here
Comment 13 Mav 2017-02-22 23:11:56 UTC
I'm an Arch user and had this one since an update too. 

A search inside .config turned out lines like: "Forward=Alt+Right; Forward; Alt+Right; Forward" inside "~/.config/kdeglobals". The duplication seemed weird, removing kdeglobals and loging out and back in fixed the issue (of course the removed settings like the desktop theme needed to be configured afterwards).
Comment 14 Albert Astals Cid 2017-02-28 22:16:35 UTC
So everyone that is getting this errors has that broken kdeglobals file?
Comment 15 Christoph Feck 2017-03-01 00:29:53 UTC
*** Bug 353695 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Feck 2017-03-01 00:30:06 UTC
*** Bug 376994 has been marked as a duplicate of this bug. ***
Comment 17 Lukas Tines 2017-03-01 21:03:01 UTC
Deleting Shortcuts section from ~/.config/kdeglobals and then log out / log in seems to fix the issue for me. You will loose all custom shortcuts i guess. 

I had a lot of duplicated shortcuts in mine.
Comment 18 Albert Astals Cid 2017-03-03 21:17:05 UTC
Did those duplicated global shortcuts actually work?

Any idea how you may have gotten them there? Did you ever edit your global shortcuts?
Comment 19 Lukas Tines 2017-03-04 08:43:03 UTC
There were bunch of pretty basic shortcuts, like CTR+C/V/X so I believe they worked.

No idea how they got there. I change shortcuts very rarely and haven't done that in past few months.
Comment 20 Mav 2017-03-04 11:15:10 UTC
Created attachment 104361 [details]
Broken kdeglobals with duplicate shortcuts

Using shortcuts "Reset to defaults" in the settings doesn't fix the errors produced by that config...
Comment 21 Mav 2017-03-04 11:15:42 UTC
Comment on attachment 104361 [details]
Broken kdeglobals with duplicate shortcuts

At my end, I think the shortcuts were broken in a way long before the recent updates (I had some shortcuts throwing errors in Kate when used since many month), it seems that since 5.30 the errors just started being reported at app launch rather then when the shortcut is used.

I'm skeptical I can reproduce breaking them, but may be we should check why resetting all shortcuts to defaults in the settings didn't fix the issue. I'm attaching my old/broken kdeglobals if you want to test with it.
Comment 22 Albert Astals Cid 2017-03-06 21:58:33 UTC
Git commit 59b184735c057482995cc0a8014bb90d12f09cf9 by Albert Astals Cid.
Committed on 06/03/2017 at 21:58.
Pushed by aacid into branch 'master'.

Sanitize shortcut list on read/write from kdeglobals

For some reason some people have kdeglobals entries like
   Close=Ctrl+W; Ctrl+Esc; Ctrl+W; Ctrl+Esc;
having the same shortcut more than once in the shortcut declaration is clearly bogus so fix it
REVIEW: 129987

M  +20   -0    src/gui/kstandardshortcut.cpp

https://commits.kde.org/kconfig/59b184735c057482995cc0a8014bb90d12f09cf9
Comment 23 Christoph Feck 2017-08-30 11:18:07 UTC
*** Bug 383268 has been marked as a duplicate of this bug. ***