The pause feature of Kmahjongg is somewhat broken: A) 1. pause & minimize Kmj 2. wait some seconds 3. restore Kmj -> Kmj is still paused, but time is increased (<- error) B) 1. maximize Kmj 2. minimize & wait some seconds 3. restore Kmj -> Kmj is paused, no timer increased 4. minimize Kmj (it is still paused) & wait some seconds 5. restore Kmj -> Kmj is unpaused and timer continued while minimized. (<- error)
A is side effect of pause on minimize. Since pause toggles between pause/unpause and the game is already paused, the pause triggered by the minimize will unpause the game and the pause triggered by restoring the window pauses the game. With B we have a similar story, except that it also shows a problem in the conditions for unpausing on restore: 1. Sets window state to maximized 2. Minimize pauses the game, this sets the window sate to minimized and maximized 3. Restore checks if the previous window state was minimized It was not, it was minimized and maximized, so no unpause it triggered. 4. Second minimize unpauses the game 5. Same as 4 So in summary I believe we have three problems here: 1. Minimizing while paused will unpause the game 2. Unpausing the game on restore of the window does not work if the window is maximized 3. Restoring the window will unpause the game even if it was manually paused before minimizing (assuming 1 is fixed).
Git commit a1f8504f95140bdf082f6c8a948c78dd37de1b17 by Albert Astals Cid, on behalf of Jan-Peter Nilsson. Committed on 14/12/2014 at 18:02. Pushed by aacid into branch 'Applications/14.12'. Make unpause on restore work for maximized window For a maximied window the oldState will also contain Qt::WindowMaximized so we need to filter out just the bit flag we are interested in. As there is several problems described in bug 332656 this is just a partial correction. M +4 -3 kmahjongg.cpp http://commits.kde.org/kmahjongg/a1f8504f95140bdf082f6c8a948c78dd37de1b17
Created attachment 90111 [details] Don't unpause already paused game on minimize
This code has been refactored. Some branches are merged into master now and the curent behaviour is: - pause the game on minimise - unpause on window restore - if the user paused the game manually, do not unpause on windopw restore Please test master version and reopen if you think this issue has not been handled properly.