Bug 499045 - Ambigous shortcut on a clean Kate settings
Summary: Ambigous shortcut on a clean Kate settings
Status: RESOLVED UPSTREAM
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 24.12.1
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-23 10:08 UTC by Daniele Scasciafratte
Modified: 2025-01-27 06:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
the error (55.88 KB, image/png)
2025-01-23 10:08 UTC, Daniele Scasciafratte
Details
shortcut list (14.05 KB, image/png)
2025-01-23 10:41 UTC, Daniele Scasciafratte
Details
log after compiling and running kate (442.41 KB, application/gzip)
2025-01-23 11:13 UTC, Daniele Scasciafratte
Details
after changing to ctrl+alt+ò (432.83 KB, application/gzip)
2025-01-23 11:33 UTC, Daniele Scasciafratte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Scasciafratte 2025-01-23 10:08:30 UTC
Created attachment 177612 [details]
the error

SUMMARY
I am just opening my Kate 24.12.1, just opening the editor and pressing Ctrl+Alt+O I get the alert in the screenshot attached.
Plugin enabled: search/replace, lsp client, project, git blame, file picker, external tools and shell plugin enabled.
I have just the text code panel, with the bottom bar with output/search/project/shell/diagnostic and a sidebar with project/git/file system and project symbols.

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian Sid
KDE Plasma Version: 24.12

ADDITIONAL INFORMATION

https://www.reddit.com/r/kde/comments/1i2mr9m/comment/m8a1r69/?context=3
Comment 1 Waqar Ahmed 2025-01-23 10:39:11 UTC
The weird thing is that it is complaining about Ctrl+O while you are pressing Ctrl+Alt+O.

- Does this always happen?
- Can you open shortcut editor from "Main menu -> Settings -> Configure Keyboard shortcuts.." and check which shortcuts have "Ctrl+O" assigned?
Comment 2 Daniele Scasciafratte 2025-01-23 10:41:07 UTC
Created attachment 177613 [details]
shortcut list
Comment 3 Daniele Scasciafratte 2025-01-23 10:42:16 UTC
I attached a screen from the shortcut configuration in Kate.

I have the same issue with Ctrl+Alt+I.

Kate is the only one with the issue in my testing but you can let me know what kind of other tests I can do I am happy to do them.
Comment 4 Waqar Ahmed 2025-01-23 10:42:35 UTC
Also, can you try disabling plugins one by one and see if the error stops?
Comment 5 Waqar Ahmed 2025-01-23 10:45:16 UTC
Could be related to: https://bugs.kde.org/show_bug.cgi?id=495994
Comment 6 Daniele Scasciafratte 2025-01-23 10:45:36 UTC
Disabled all of them but I still have that issue.
Comment 7 Daniele Scasciafratte 2025-01-23 10:46:52 UTC
If it can be helpful I can compile kate and try to do some patches.
Comment 8 Waqar Ahmed 2025-01-23 10:54:22 UTC
Yes, that'd be helpful and probably it will be easier to debug that way since you can reproduce the problem.

Also, can you try enabling all logging by doing:

export QT_LOGGING_RULES="*=true"
kate -b -n &> logs

Then reproduce the issue and quit kate.

---

Can you try something similar to what the person in the linked bug tried? E.g., remove shortcut for Ctrl+O and see if Ctrl+Alt+O starts working
Comment 9 Daniele Scasciafratte 2025-01-23 11:13:14 UTC
Removed the shortcut and when I do that one just open the menu in the toolbar for the settings.

I am compiling it from the debian source and executed that export before starting the compiling, I am attaching the log generated.
Comment 10 Daniele Scasciafratte 2025-01-23 11:13:53 UTC
Created attachment 177615 [details]
log after compiling and running kate
Comment 11 Waqar Ahmed 2025-01-23 11:27:06 UTC
From the logs you provided:

qt.qpa.keymapper: Computing possible key combinations for QKeyEvent(ShortcutOverride, Key_Oacute, ControlModifier|AltModifier, text="ó", nativeScanCode=32, nativeVirtualKey=243)
qt.qpa.keymapper: Resulting possible key combinations:
qt.qpa.keymapper: 	- QKeyCombination(ControlModifier|AltModifier, Key_Oacute) / QKeySequence("Ctrl+Alt+Ó") / Ctrl+Alt+Ó
qt.qpa.keymapper: 	- QKeyCombination(AltModifier, Key_O) / QKeySequence("Alt+O") / Alt+O
qt.qpa.keymapper: 	- QKeyCombination(ControlModifier, Key_O) / QKeySequence("Ctrl+O") / Ctrl+O
qt.gui.shortcutmap: Creating new sequences for QKeyEvent(ShortcutOverride, Key_Oacute, ControlModifier|AltModifier, text="ó") with ignoredModifiers= QFlags<Qt::KeyboardModifier>(NoModifier)
qt.gui.shortcutmap: Possible input sequences: QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O"))
qt.gui.shortcutmap: Looking for shortcuts matching QKeySequence("Ctrl+O")
qt.gui.shortcutmap:  - QKeySequence::ExactMatch for shortcut QKeySequence("Ctrl+O")
qt.gui.shortcutmap:  - QKeySequence::ExactMatch for shortcut QKeySequence("Ctrl+O")
qt.gui.shortcutmap:   - But context was not correct
qt.gui.shortcutmap:  - QKeySequence::NoMatch for shortcut QKeySequence("Ctrl+P")
qt.gui.shortcutmap: Found better match ( QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O")) ), clearing key sequence list
qt.gui.shortcutmap: Added ok key sequence QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O"))
qt.gui.shortcutmap: Looking for shortcuts matching QKeySequence("Alt+O")
qt.gui.shortcutmap:  - QKeySequence::ExactMatch for shortcut QKeySequence("Alt+O")
qt.gui.shortcutmap:  - QKeySequence::NoMatch for shortcut QKeySequence("Alt+P")
qt.gui.shortcutmap: Found better match ( QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O")) ), clearing key sequence list
qt.gui.shortcutmap: Added ok key sequence QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O"))
qt.gui.shortcutmap: Looking for shortcuts matching QKeySequence("Ctrl+Alt+Ó")
qt.gui.shortcutmap:  - QKeySequence::NoMatch for shortcut QKeySequence("Ctrl+Alt+Return")
qt.gui.shortcutmap: Returning shortcut match ==  QKeySequence::ExactMatch
qt.gui.shortcutmap: QShortcutMap::nextState(QKeyEvent(ShortcutOverride, Key_Oacute, ControlModifier|AltModifier, text="ó")) = QKeySequence::ExactMatch
qt.gui.shortcutmap: The following shortcuts are about to be activated ambiguously:
qt.gui.shortcutmap: - QKeySequence("Ctrl+O") (belonging to KOpenAction(0x56020a02e0e0, name = "file_open"))
qt.gui.shortcutmap: - QKeySequence("Alt+O") (belonging to QMenuBar(0x56020a01a3e0))
qt.gui.shortcutmap: QShortcutMap::dispatchEvent(): Sending QShortcutEvent(""Ctrl+O"", -35, true) to object(KOpenAction(0x56020a02e0e0, name = "file_open"))
qt.gui.shortcutmap: QShortcutMap::addShortcut(QPushButton(0x56020bcd9300), QKeySequence("Alt+O"), Qt::WindowShortcut) added shortcut with ID -389

---

It seems like when you press Ctrl+Alt+O it is actually: "Ctrl+Alt+Ó". Qt breaks that down into Ctrl+O, and Alt+O and tries to dispatch these shortcuts. Which results in a conflict:

qt.gui.shortcutmap: The following shortcuts are about to be activated ambiguously:
qt.gui.shortcutmap: - QKeySequence("Ctrl+O") (belonging to KOpenAction(0x56020a02e0e0, name = "file_open"))
qt.gui.shortcutmap: - QKeySequence("Alt+O") (belonging to QMenuBar(0x56020a01a3e0))

So I guess the problem is that you need to ensure: `"Ctrl+Alt+O"` is actually Ctrl+Alt+O, and not something else.

----

For reference, here's the output on my system:

qt.qpa.keymapper: Computing possible key combinations for QKeyEvent(ShortcutOverride, Key_O, ControlModifier|AltModifier, text="\u000F", nativeScanCode=32, nativeVirtualKey=111)
qt.qpa.keymapper: Resulting possible key combinations:
qt.qpa.keymapper: 	- QKeyCombination(ControlModifier|AltModifier, Key_O) / QKeySequence("Ctrl+Alt+O") / Ctrl+Alt+O
qt.gui.shortcutmap: Creating new sequences for QKeyEvent(ShortcutOverride, Key_O, ControlModifier|AltModifier, text="\u000F") with ignoredModifiers= QFlags<Qt::KeyboardModifier>(NoModifier)
qt.gui.shortcutmap: Possible input sequences: QList(QKeySequence("Ctrl+Alt+O"))
qt.gui.shortcutmap: Looking for shortcuts matching QKeySequence("Ctrl+Alt+O")
qt.gui.shortcutmap:  - QKeySequence::ExactMatch for shortcut QKeySequence("Ctrl+Alt+O")
qt.gui.shortcutmap:  - QKeySequence::NoMatch for shortcut QKeySequence("Ctrl+Alt+P")
qt.gui.shortcutmap: Found better match ( QList(QKeySequence("Ctrl+Alt+O")) ), clearing key sequence list
qt.gui.shortcutmap: Added ok key sequence QList(QKeySequence("Ctrl+Alt+O"))
qt.gui.shortcutmap: Returning shortcut match ==  QKeySequence::ExactMatch
qt.gui.shortcutmap: QShortcutMap::nextState(QKeyEvent(ShortcutOverride, Key_O, ControlModifier|AltModifier, text="\u000F")) = QKeySequence::ExactMatch
qt.gui.shortcutmap: QShortcutMap::dispatchEvent(): Sending QShortcutEvent(""Ctrl+Alt+O"", -27, false) to object(QAction(0x55f4648f69b0, name = "view_quick_open"))
Comment 12 Waqar Ahmed 2025-01-23 11:31:18 UTC
Another thing that will probably work as well is to remove the existing shortcut for Quick Open and then set it again. This will probably set it to Ctrl+Alt+Ó and it will work again.
Comment 13 Daniele Scasciafratte 2025-01-23 11:33:44 UTC
That's interesting, I am using the UK extended windows keyboard layout.

So probably in my system there is a wrong identification of shortcuts, so maybe it is a plasma issue instead of Kate but I was able to spot it there.

I have configured as ctrl+alt+ò but I am getting another ambigous window for ctrl+o.
I am attaching the log again.
Comment 14 Daniele Scasciafratte 2025-01-23 11:33:58 UTC
Created attachment 177616 [details]
after changing to ctrl+alt+ò
Comment 15 Waqar Ahmed 2025-01-23 11:42:19 UTC
Hmm, that seems to be a qt issue?

qt.gui.shortcutmap: Looking for shortcuts matching QKeySequence("Ctrl+Alt+Ó")
qt.gui.shortcutmap:  - QKeySequence::ExactMatch for shortcut QKeySequence("Ctrl+Alt+Ó")
qt.gui.shortcutmap:  - QKeySequence::NoMatch for shortcut QKeySequence("Ctrl+Alt+Return")
qt.gui.shortcutmap: Found better match ( QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O")) ), clearing key sequence list
qt.gui.shortcutmap: Added ok key sequence QList(QKeySequence("Ctrl+Alt+Ó"), QKeySequence("Alt+O"), QKeySequence("Ctrl+O"))
qt.gui.shortcutmap: Returning shortcut match ==  QKeySequence::ExactMatch
qt.gui.shortcutmap: QShortcutMap::nextState(QKeyEvent(ShortcutOverride, Key_Oacute, ControlModifier|AltModifier, text="ó")) = QKeySequence::ExactMatch
qt.gui.shortcutmap: The following shortcuts are about to be activated ambiguously:
qt.gui.shortcutmap: - QKeySequence("Ctrl+O") (belonging to KOpenAction(0x560632b35610, name = "file_open"))
qt.gui.shortcutmap: - QKeySequence("Alt+O") (belonging to QMenuBar(0x560632c9e460))
qt.gui.shortcutmap: QShortcutMap::dispatchEvent(): Sending QShortcutEvent(""Ctrl+O"", -35, true) to object(KOpenAction(0x560632b35610, name = "file_open"))
qt.gui.shortcutmap: QShortcutMap::addShortcut(QPushButton(0x560634ca2ec0), QKeySequence("Alt+O"), Qt::WindowShortcut) added shortcut with ID -390

it finds 

qt.gui.shortcutmap:  - QKeySequence::ExactMatch for shortcut QKeySequence("Ctrl+Alt+Ó")

but then ignores that and just does the same as before:

qt.gui.shortcutmap: The following shortcuts are about to be activated ambiguously:
qt.gui.shortcutmap: - QKeySequence("Ctrl+O") (belonging to KOpenAction(0x560632b35610, name = "file_open"))
qt.gui.shortcutmap: - QKeySequence("Alt+O") (belonging to QMenuBar(0x560632c9e460))
Comment 16 Daniele Scasciafratte 2025-01-23 11:43:48 UTC
Do you have suggestions on how to report on QT or if it is a qt bug?
Who it is the right person to reach?
Comment 17 Waqar Ahmed 2025-01-23 11:50:06 UTC
It seems like a Qt issue to me

Qt bug reports are here: https://bugreports.qt.io/
Comment 18 Waqar Ahmed 2025-01-23 11:52:30 UTC
This is for sure a problem lower in the stack so I will close this bug for now.

The most likely workaround for you will be to ensure O doesn't change to Ó. Direct shortcut with Ó doesn't work, which is a little bit sad.
Comment 19 Daniele Scasciafratte 2025-01-23 14:07:41 UTC
Ticket opened https://bugreports.qt.io/browse/QTBUG-133134 I hope that I explained at my best.
Comment 20 Waqar Ahmed 2025-01-27 06:17:17 UTC
Needs to be fixed upstream. We (Kate) can't do anything more here.