Bug 374311

Summary: it is too easy to activate context menu item if mouse moves during right-click
Product: [Plasma] Breeze Reporter: S. Christian Collins <s_chriscollins>
Component: generalAssignee: Plasma Development Mailing List <plasma-devel>
Status: RESOLVED FIXED    
Severity: normal CC: anonkun, bugs5.kde.org, krzmbrzl, lv215bd5, nate, raghu, romuluspb, simonandric5
Priority: NOR Keywords: usability
Version: 5.8.5   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
URL: https://bugreports.qt.io/browse/QTBUG-57849
See Also: https://bugs.kde.org/show_bug.cgi?id=410493
Latest Commit: Version Fixed In: 5.25

Description S. Christian Collins 2016-12-29 23:22:33 UTC
Please see the following video:
https://youtu.be/5U9XQgf3NXI

When using applications in KDE, it is very easy to accidentally activate a context menu item if the mouse cursor is not perfectly steady during the right mouse click that brings up the menu. As you can see in the video, in some cases the cursor only needs to travel 2 pixels between mouse press and release to activate the menu item.

Steps to reproduce:
1. Open Dolphin and move it to the bottom right-hand corner of the screen.
2. Right-click (and keep the mouse button down) in the white space near the bottom right-hand corner of Dolphin. The context menu should open just above the mouse cursor.
3. Move the mouse up 2 pixels and release the mouse button.

Result: The bottom entry of the context menu is activated. The problem is that this all too often happens very quickly if my mouse is not steady, or my trackpad's accuracy sucks (which it does). For example, I can't tell you how many times I've accidentally disabled a clip in this manner when editing videos in Kdenlive.

Some possible solutions include:
1. If a right mouse click is very short (very little time between mouse press and release), a context menu item shouldn't be activated on mouse button release.
2. Set a minimum number of pixels the mouse cursor must move between launching the menu (mouse right button press) and activating the menu item (mouse right button release).
3. Add a few pixels of padding region around the context menu where the cursor can exist without a menu item being selected. This solution already exists in the Oxygen widget style, as seen at the end of the video.
4. Have the context menu appear a few pixels away from the mouse cursor instead of right at the tip of the pointer. This solution would function similar to solution #3, but without causing potential changes to the appearance of the widget style.

I didn't know exactly which component to report this bug against, since as far as I know it could be a KDE, Qt, or Breeze issue. Please reassign as necessary.

** My System **
OS: KDE Neon 5.8.90 64-bit (Plasma Desktop 5.8.5+git20161227.1802-0, KDE Frameworks 5.30.0, Qt 5.7.0)
Linux Kernel: 4.4.0.57-generic
Comment 1 Christoph Feck 2016-12-30 02:24:36 UTC
This needs to be fixed in Qt, and was already reported, but some Qt bug triager did not believe it is possible to select a menu item without explicitely clicking on it, so it was closed as invalid.

I suggest to report it again via https://bugreports.qt.io/ and hope that someone else can reproduce.
Comment 2 Christoph Feck 2016-12-30 02:28:36 UTC
https://bugreports.qt.io/browse/QTBUG-6632
Comment 3 S. Christian Collins 2016-12-30 16:03:49 UTC
I have reported this bug for Qt here: https://bugreports.qt.io/browse/QTBUG-57849
Comment 4 Christoph Feck 2017-11-30 21:55:35 UTC
*** Bug 387459 has been marked as a duplicate of this bug. ***
Comment 5 Christoph Feck 2019-07-26 16:21:15 UTC
*** Bug 410236 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2019-08-01 19:30:23 UTC

*** This bug has been marked as a duplicate of bug 410493 ***
Comment 7 Raghavendra kamath 2020-05-11 07:03:02 UTC
This issue is more serious when you use a pen tablet with programs such as Krita and Kdenlive. Often times due to pen being not steady the first menu entry is clicked. This sometimes happens so fast that you can't see the menu appear fully.
Comment 8 Christoph Feck 2020-07-21 15:11:56 UTC
*** Bug 424444 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2020-10-24 16:09:28 UTC
*** Bug 387459 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2020-10-24 16:09:34 UTC
*** Bug 410236 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2020-10-24 16:10:03 UTC
Needs to be fixed in Qt. See https://bugreports.qt.io/browse/QTBUG-57849
Comment 12 Christoph Feck 2020-12-04 17:21:45 UTC
*** Bug 430014 has been marked as a duplicate of this bug. ***
Comment 13 krzmbrzl 2021-08-15 10:53:17 UTC
What is the status of this? I am still having this issue but all Qt bug reports I found on this were closed for one reason or another.

Generally speaking though I think another solution would be to straight off disable selecting anything using the right mouse button. You can't trigger regular buttons with the right mouse button, so why should you be able to select a context menu entry with it?
Idk if this is something that you even have control of or whether this (too) is something that has to be fixed on Qt's side.
Comment 14 Christoph Feck 2021-08-16 00:17:30 UTC
Qt developers say it is fixed in Qt 6.
Comment 15 krzmbrzl 2021-08-16 05:44:59 UTC
Okay thanks. Guess that means we're stuck with this until KDE switches to Qt 6.
Comment 16 Janet Blackquill 2022-02-17 23:56:53 UTC
Git commit 3993ab7900986b2c594ccad34ab93d30ff346f01 by Jan Blackquill, on behalf of Janet Blackquill.
Committed on 17/02/2022 at 23:42.
Pushed by ngraham into branch 'master'.

kstyle: add menu margin

This is more consistent with Plasma and our qqc2-desktop-style.
Related: bug 445886
FIXED-IN: 5.25

M  +1    -0    kstyle/breezemetrics.h
M  +4    -0    kstyle/breezestyle.cpp

https://invent.kde.org/plasma/breeze/commit/3993ab7900986b2c594ccad34ab93d30ff346f01