Summary: | Highlighting menu: Keyboard accelerators wrong when shown the first time | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Dmitry Balabka <malecspalec> |
Component: | kdeui | Assignee: | kdelibs bugs <kdelibs-bugs-null> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | minor | CC: | cfeck, christoph, galdralag |
Priority: | NOR | ||
Version First Reported In: | 3.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | patch to kdeui |
Description
Dmitry Balabka
2011-05-14 12:41:38 UTC
When opening the Highlighting menu the first time, the entries "Scientific", "Scripts" and "Sources" all have the accelerator "&S". However, when opening the menu the second time, this issue is solved. The reason for the multiple assignment of the accelerators is that we use the code QMenu *qmenu = new QMenu ('&'+hlSection); in KateHighlightingMenu::slotAboutToShow(). We do use KAcceleratorManager [1] to automatically solve such clashes. However, the Highlighting menu is created on the fly by filling it in the slot KateHighlightingMenu::slotAboutToShow(). KAcceleratorManager also uses the signal aboutToShow() to handle dynamically chaning menus. So the problem probably is that the accelerator manager checks clashes too early, i.e. before the highlighting menu is filled. [1] http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKAcceleratorManager.html As followup from the kde-devel mailing list: A possible solution is to make the KAcceleratorManager use the QShowEvent by using an event filter. Right now, the constructor handling popup menus says (kdelibs/kdeui/shortcuts/kacceleratormanager.cpp): KPopupAccelManager::KPopupAccelManager(QMenu *popup) : QObject(popup), m_popup(popup), m_count(-1) { aboutToShow(); // do one check and then connect to show connect(popup, SIGNAL(aboutToShow()), SLOT(aboutToShow())); } Here, the event filter has to be installed on the popup menu. Does anyone have a kdelibs build to try this? *** Bug 257960 has been marked as a duplicate of this bug. *** Created attachment 75007 [details] patch to kdeui This patch implements what is suggested on the mailing list: http://lists.kde.org/?l=kde-devel&m=130546957219649&w=2 I use KDE with this patch for 10 days now, and I'm not annoyed anymore by this bug :) However, this is somewhat blind-programming because I don't know Qt/KDE API enough to explain why it seems to fix the bug (hence the lack of commit message in the patch). Hi, kdelibs (version 4 and earlier) is no longer maintained since a few years. KDE Frameworks 5 or 6 might already have resolved this bug. If not, please re-open against the matching framework if feasible or against the application that shows the issue. We then can still dispatch it to the right Bugzilla product or component. Greetings Christoph Cullmann |