Bug 155531

Summary: Mouse clicks are not recognised if the mouse moves at all during the click
Product: [Plasma] plasma4 Reporter: James Ots <kde>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description James Ots 2008-01-12 17:01:43 UTC
Version:            (using KDE KDE 4.0.0)
Installed from:    SuSE RPMs
OS:                Linux

I've noticed this bug in two places so far: 1. When I add an application icon to the panel. 2: When clicking on the buttons which appear when you mouse over the yellow blob in the top right of the desktop.

I use a graphics tablet, and so it is almost impossible to click and release the mouse in exactly the same position - the pointer will usually move a pixel or two during the click. However, in at least the two places I listed, plasma requires no movement of the mouse between press and release - which makes it pretty much unuseable for a graphics tablet user.

Excepted behaviour: I would expect that once the mouse has been pressed, it can move around as much as you like - including off the icon, and the click event would still be fired so long as the pointer was within the icon when the mouse button was released.
Comment 1 Jason Stubbs 2008-01-12 18:07:40 UTC
SVN commit 760441 by jstubbs:

Have the icon applet explicitly tell the icon widget that a clicked() signal
isn't wanted after a mouse move rather than the widget assuming so. This means
that icon applets that can't be dragged act like regular buttons again.

Ok to commit this to 4.0 as well?

BUG: 155531


 M  +2 -7      libs/plasma/widgets/icon.cpp  
 M  +0 -1      libs/plasma/widgets/icon_p.h  
 M  +3 -0      plasma/applets/icon/icon.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=760441
Comment 2 Aaron J. Seigo 2008-01-13 01:05:25 UTC
the patch is unfortunately wrong.

now when a drag of a desktop icon is complete, the icon is launched. this obviously shouldn't happen.

we can't rely on QGraphicsItem::ItemPositionChange since we don't get that when embedded in another item. we can't rely on the Icon widget being set to non-movable itself for the same reason.

i think the only real solution will be to capture the scene coordinates on mouse down, and compare them with the scene coordinates on mouse up before emitting clicked.
Comment 3 Jason Stubbs 2008-01-13 04:11:39 UTC
Dragging of a desktop icon works fine here.. How are you getting the launch to happen?
Comment 4 Christopher Blauvelt 2008-01-13 10:00:15 UTC
Did you forget to include some of your changed files in the check-in?
Comment 5 Aaron J. Seigo 2008-01-13 12:20:16 UTC
no, it's that i tested libplasma itself, not in conjunction with the icon applet. in fact, the changes to the icon applet are not rather unnecessary as i've fixed the icon widget directly.