Bug 262498

Summary: Double click has to be done twice
Product: [Applications] kpat Reporter: Ian Wadham <iandw.au>
Component: generalAssignee: Stephan Kulow <coolo>
Status: RESOLVED FIXED    
Severity: normal CC: coates, kde-games-bugs
Priority: NOR    
Version: 0.7.4   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: The card at the bottom is ready to be played.
The card at the bottom has been double-clicked but the only effect is to shrink the column. The card should have moved up to the pile in the top of the picture.

Description Ian Wadham 2011-01-08 07:37:32 UTC
Created attachment 55726 [details]
The card at the bottom is ready to be played.

Version:           0.7.4 (using Devel) 
OS:                Linux

Playing Mod3 I usually use double click to make a card go to its solution spot. In trunk from two days ago, double-click on a column in the bottom row at first just makes the column shrink up. It takes another double-click to make the card go to its solution spot. See the two attachments.

Reproducible: Always

Steps to Reproduce:
Play Mod3 to the point where there is a card in the bottom row that can be played and it has other cards underneath it. Then play the card by double-clicking.

Actual Results:  
You need four clicks to play the card (two double-clicks).

Expected Results:  
One double-click should be enough to play the card.

OS: Linux (i686) release 2.6.31.14-0.1-desktop
Compiler: gcc
Comment 1 Ian Wadham 2011-01-08 07:41:06 UTC
Created attachment 55727 [details]
The card at the bottom has been double-clicked but the only effect is to shrink the column. The card should have moved up to the pile in the top of the picture.
Comment 2 Parker Coates 2011-01-08 14:27:15 UTC
That's an interesting find. I have no idea what might be causing that behaviour. My best guess is some kind of conflict between the mouse handling code and the pile layout code. I'll have to look into it further.

The good news is that I have a rather simple workaround for you in the interim. In most of KPat's games a right click performs the same action as a double click (and is less straining on the hands). For whatever reason, the issue you've reported doesn't effect right-clicks.
Comment 3 Parker Coates 2011-01-08 14:40:16 UTC
Now that I've thought about it a bit more, I think I know what's going on. 

 * For some reason, when a new row of cards are dealt from the stock the resulting piles aren't being properly compacted.
 * When a double click is performed, KPat first receives a mouse press event, which picks up the card, then a mouse release event which sets the card back down.
 * Normally, these two events essentially cancel each other out, but in this particular case when the card is set back down, the pile notices that it isn't properly laid out, so it starts a pile relayout animation.
 * When the second mouse press event arrives it occurs on an animated card and is therefore ignored and a double click event is never triggered.

So really the problem is really just why the initial pile heights are wrong. It also explains why right clicks aren't effected as they don't cause pile relayouts.
Comment 4 Parker Coates 2011-01-08 17:52:41 UTC
SVN commit 1212927 by coates:

Fix a pile spacing issue with flipCardToPileAtSpeed.

Face up cards are given different offsets than face down cards, so we
need to be sure that the we check the final position of the card with
the correct face-up-ness.

BUG:262498

 M  +1 -0      kcardscene.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1212927
Comment 5 Parker Coates 2011-01-08 18:03:45 UTC
SVN commit 1212929 by coates:

Backport of revision 1212927.

Fix a pile spacing issue with flipCardToPileAtSpeed.

Face up cards are given different offsets than face down cards, so we
need to be sure that the we check the final position of the card with
the correct face-up-ness.

CCBUG:262498



 M  +1 -0      kcardscene.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1212929