Bug 423860 - New "copy location" RMB menu option is too sticky
Summary: New "copy location" RMB menu option is too sticky
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-04 07:08 UTC by Oded Arbel
Modified: 2020-10-26 00:07 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2020-07-04 07:08:20 UTC
SUMMARY
After right clicking a "link" and seeing the new RMB menu option "Copy Location", that option is shown in the RMB menu when right clicking anywhere else.

STEPS TO REPRODUCE
1. Open Konsole and run `ls`
2. Hover over one of the entries listed and right click - verify that "Copy location" is one of the options in the menu.
3. Dismiss the menu without selecting any option.
4. Right click anywhere else other than another ls entry output - such as an empty area of the Konsole screen or some other text.

OBSERVED RESULT
The "Copy location" option is still shown, and clicking it results in Konsole copying the location of the last thing that "Copy location" was relevant for.

EXPECTED RESULT
The "Copy location" option should not be listed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon developer edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.72.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
The "Copy location" option can be removed by hovering over another entry that would normally have a "Copy location" option when right-clicking on, but without clicking.

So something like this:
1. Execute `ls`
2. Hover over one of the entries and right-click - "Copy location" shown.
3. Dismiss menu without choosing anything.
4. Hover over an empty space and right-click - "Copy location" still shown.
5. Dismiss menu without choosing anything.
6. Hover over another of the `ls` entries (*do not* right-click).
7. Hover over an empty space and right-click - "Copy location" no longer shown.
Comment 1 Oded Arbel 2020-07-04 07:13:48 UTC
It looks like this problem only reproduces if you close the menu (either by dismissing or choosing one of the options - even "Copy location") after moving the mouse away from the entry that triggered "Copy location" being available.

It does trigger, for example, if you right-click then move the mouse to the "Copy location" option and click on it. If you then right click again, you'd see the "Copy location" option even though the mouse is no longer on the entry that triggered "Copy location". It doesn't trigger, for example, if you right-click then use the keyboard to choose "Copy location", then move the mouse away from the entry after the menu is closed. I'm guessing the "on mouse out" event - or some such - fires correctly in that case, but it doesn't if the menu is still open while the mouse is moved away.
Comment 2 Kurt Hindenburg 2020-07-05 12:02:11 UTC
I was able to reproduce this sometimes.  If you select 'Copy Location' while the mouse isn't over the previous link, that link is still copied.
Comment 3 Nate Graham 2020-07-07 19:37:27 UTC
Hmm, cannot reproduce with konsole from git master as of today.
Comment 4 Oded Arbel 2020-07-09 22:48:45 UTC
(In reply to Nate Graham from comment #3)
> Hmm, cannot reproduce with konsole from git master as of today.

I can still repro with Konsole in Neon developer edition package version 4:20.04.3+p20.04+git20200709.1146-0
Comment 5 Kurt Hindenburg 2020-10-26 00:07:00 UTC
Git commit 53af2a7fb96588ac04cb4a319badf2dc62ff51c8 by Kurt Hindenburg, on behalf of Carlos Alves.
Committed on 26/10/2020 at 00:06.
Pushed by hindenburg into branch 'master'.

Fix 'Copy Location' and 'Open With' issues with context menu

Update mouse events in mousePressEvent so the events are updated with the mouse stopped as well as moving.
Related: bug 426359
FIXED-IN: 20.08.3

M  +0    -10   src/filterHotSpots/FileFilterHotspot.cpp
M  +9    -8    src/session/SessionController.cpp
M  +4    -0    src/terminalDisplay/TerminalDisplay.cpp

https://invent.kde.org/utilities/konsole/commit/53af2a7fb96588ac04cb4a319badf2dc62ff51c8