Bug 354065 - kpat has a problem with redo and undo. Does not refresh the situation or does refresh with large delay.
Summary: kpat has a problem with redo and undo. Does not refresh the situation or does...
Status: RESOLVED FIXED
Alias: None
Product: kpat
Classification: Applications
Component: general (show other bugs)
Version: 3.6
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-18 21:48 UTC by stakanov
Modified: 2020-12-02 21:57 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stakanov 2015-10-18 21:48:22 UTC
Take a game, let us say solitaire. 
Play it (in my case 4 card "hard" and go up to a certain point. 
Try not to "undo" moves or "redo" moves. When undoing two steps in a row and fast, this will not happen. Card stays either there (double presence on the old and the new position) or they "vanish". When you click on the place where they should be and if other cards where invisible, they appear also. This is repeatable, always. 
Opensuse Leap RC1 
Utilizza: 
KDE Frameworks 5.15.0
Qt 5.5.0 (compilato con 5.5.0)
Il sistema di finestre xcb

One can note a certain flicker from time to time. 

Reproducible: Always

Steps to Reproduce:
1. open a game, like solitaire, play some moves. 
2. undo at least two steps in a row
3. cards will not show up correctly in new position, will vanish or be present twice (old and new). 
4. click on one of the places where you know a card should be there they reappear.

Actual Results:  
card refresh with undo is erratic. This is not O.K. because confusing the player note-worthily as the new positions seem real, you are not even understanding at first what happened. If you play then the all positions do appear. That can lead to 4 or 5 cards suddenly moving in "new position" if you thought you did not press undo rightly. You did, but you could not see it. As soon as you click on a card to play the positions "normalize" with a flashing flicker. 

Expected Results:  
good old kpat should work as brilliantly annoyingly reliably as in kde4 (Guys to be honest I would have NEVER thought I am going to write this one day on KDE4 lol ;-) ) . 

Grapics: Nvidia GT-210 (old, old) with single monitor over DVI. 
Resolution 1920-1080.
A lot of flicker all around, may be connected to plasma or to the state of leap being RC1 and not proprietary driver are available....still.
Comment 1 Tomi Leppänen 2017-06-08 21:19:49 UTC
I can reproduce this. I think this is easiest to reproduce with Spider solitaire. Do some moves then undo some and redo them. Should be clearly visible. I can't take a screenshot since the problem disappears if I try to do that.

My system:
Fedora 25, KPatience 3.6. I tried also git master, seems to work the same.

I already figured out that adding just a tiny bit of duration to the animation (from 0 to 1) makes this work, but it won't look very nice when the card just quickly flashes. There is probably a way to tell it to update that part of the screen or the whole game, but I haven't yet figured that out. Or maybe the animation code needs to be fixed.

If someone wants to try the workaround I mentioned, here is a quick patch:
diff --git a/dealer.cpp b/dealer.cpp
index dfee5e4..eb263c8 100644
--- a/dealer.cpp
+++ b/dealer.cpp
@@ -1219,7 +1219,7 @@ void DealerScene::undoOrRedo( bool undo )
                     p->swapCards( i, index );
             }
 
-            updatePileLayout( p, 0 );
+            updatePileLayout( p, 1 );
         }
 
         emit updateMoves( moveCount() );

I didn't make a real patch since it I don't think this is proper way to fix this, but it might provide some ideas to fix this properly.
Comment 2 stakanov 2020-12-02 21:57:37 UTC
For what I know this bug does not occur any more.