GNOME Bugzilla – Bug 731307
Do not gray the board after the first game
Last modified: 2014-07-09 07:29:08 UTC
Hitori 0.4.1 introduced a strange bug: after the end of the first game, the board becomes grayed out, and remains so forever. (You can still tell the difference between painted and unpainted cells because they're different shades of gray.) The timer pausing fix was also not working quite as intended. This patch seems to fix both issues.
Created attachment 277979 [details] [review] Do not gray the board after the first game The board would become grayed out after the end of the first game, and remain so forever. Also, the timer would not stop until the congratulations dialog was dismissed. Looks like be2ba012e75546b09e9938b7386adbd721a9cab8 did not go quite right.
Review of attachment 277979 [details] [review]: This looks OK, but means that when I alt-tab from Hitori to another window, the timer continues to count even though the Hitori window is not focussed and potentially not visible. It would be better if the fix could preserve the old behaviour of pausing the timer when the window loses focus. Unless there's some convention for this in gnome-games?
Good point, I should not have changed that. The convention is indeed to stop the clock, but also to draw an overlay over the board so that the user can't see the board while the clock is stopped. There is normally also a pause/resume button.
(In reply to comment #3) > The convention is indeed to stop the clock, but also to draw an overlay over > the board so that the user can't see the board while the clock is stopped. > There is normally also a pause/resume button. That sounds like a better idea. Do you want to implement that instead? I think that would mean leaving the focus-handling code unchanged, and just implementing the overlay and button.
My patch in bug #732300 fixes this incidentally. I'd recommend applying the patch in this bug to the hitori-0-4 branch only, since I don't really care too much if the timer doesn't stop when the window is unfocused (particularly in that branch), and this bug is pretty serious, and I'm not planning to spend much more time on this. The remaining loose ends from this bug are Bug #732780 and Bug #732781 (which is fixed by the patch in this bug, but not the one in bug #732300).
Created attachment 279987 [details] [review] Fix the board colours when running with GTK+ 3.13.3 The latest Adwaita theme changes its background colours, causing the Hitori board to no longer render correctly. Hard-code the colours so that Hitori rendering is independent of the GTK+ theme.
(In reply to comment #5) > My patch in bug #732300 fixes this incidentally. > > I'd recommend applying the patch in this bug to the hitori-0-4 branch only, I care whether the timer stops, so attached is a patch which fixes the colours without affecting the timer behaviour.
Review of attachment 279987 [details] [review]: Looks mostly good to me for hitori-0-4; the only remaining issue is that the Game menu remains grayed out at the end of the game as if it were insensitive (though it is not), but that's not very serious. The commit message should be rewritten, though: since I can reproduce this bug with GTK+ 3.10.9, it's not related to the theme changes. (If the bug only occurred with GTK+ 3.13 then it would not be a very big deal.)
Pushed with a different commit message and an additional fix for the latent timer issue. I couldn’t reproduce the Game menu problem you mentioned. How did you cause it? commit f3ac3301b39b2b698d67353271492cc3dff131a8 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sun Jul 6 13:41:09 2014 +0100 Make board rendering colours independent of the widget state The Hitori game board widget doesn’t make use of the GTK+ widget state (e.g. insensitive, focused) correctly, so the rendering colours should not be based on it. Hard-code the colours so that Hitori rendering is independent of the GTK+ state, until we make the game play area a proper GtkWidget and set its state flags properly. https://bugzilla.gnome.org/show_bug.cgi?id=731307 src/interface.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
(In reply to comment #9) > Pushed with a different commit message and an additional fix for the latent > timer issue. Awesome. I think that's everything that needed to happen on the hitori-0-4 branch. 0.4.1-0.4.4 are, frankly, bad releases because of this bug, so one more would be a good idea. > I couldn’t reproduce the Game menu problem you mentioned. How did > you cause it? It's (somewhat impressively) fixed by your commit "Disable the game play timer after winning," yay!
(In reply to comment #10) > I think that's everything that needed to happen on the hitori-0-4 branch. > 0.4.1-0.4.4 are, frankly, bad releases because of this bug, so one more would > be a good idea. 0.4.5 released. > > I couldn’t reproduce the Game menu problem you mentioned. How did > > you cause it? > > It's (somewhat impressively) fixed by your commit "Disable the game play timer > after winning," yay! How odd.