Summary: | Double View::contextMenuAboutToShow signals when using keyboard 'Menu' button if QEventLoop::exec is called | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-ktexteditor | Reporter: | ulterno |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | christoph |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
ulterno
2025-05-15 12:36:36 UTC
Using guidance by Igor Kushnir, I see contextMenuEvent being called twice, in case the 'Menu' key is used. The QContextMenuEvent in this case, has different addresses. The resulting QMenu pointer for the KTextEditor::View::contextMenuAboutToShow signal ends up being the same due to KTextEditor::ViewPrivate::contextMenu() using the KXMLGUIFactory We could block that until aboutToHideContextMenu is triggered. That should work since we don't open another context menu on right click when one is already open (unlike Microsoft things). It might be good if we could find out why that happens in case of Wayland and not X11. Maybe one can try checking with something other than KWin? Has somebody time to test that and provide a patch? |