After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731307 - Do not gray the board after the first game
Do not gray the board after the first game
Status: RESOLVED FIXED
Product: hitori
Classification: Applications
Component: General
0.4.x
Other All
: Normal normal
: ---
Assigned To: Michael Catanzaro
hitori-maint
Depends on: 732300
Blocks:
 
 
Reported: 2014-06-06 03:34 UTC by Michael Catanzaro
Modified: 2014-07-09 07:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not gray the board after the first game (1.36 KB, patch)
2014-06-06 03:34 UTC, Michael Catanzaro
needs-work Details | Review
Fix the board colours when running with GTK+ 3.13.3 (2.66 KB, patch)
2014-07-06 12:43 UTC, Philip Withnall
reviewed Details | Review

Description Michael Catanzaro 2014-06-06 03:34:01 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.
Comment 1 Michael Catanzaro 2014-06-06 03:34:02 UTC
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.
Comment 2 Philip Withnall 2014-06-11 08:19:26 UTC
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?
Comment 3 Michael Catanzaro 2014-06-17 13:56:15 UTC
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.
Comment 4 Philip Withnall 2014-06-17 22:30:35 UTC
(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.
Comment 5 Michael Catanzaro 2014-07-05 20:45:53 UTC
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).
Comment 6 Philip Withnall 2014-07-06 12:43:03 UTC
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.
Comment 7 Philip Withnall 2014-07-06 12:44:27 UTC
(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.
Comment 8 Michael Catanzaro 2014-07-06 16:08:35 UTC
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.)
Comment 9 Philip Withnall 2014-07-08 22:21:50 UTC
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(-)
Comment 10 Michael Catanzaro 2014-07-09 03:31:30 UTC
(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!
Comment 11 Philip Withnall 2014-07-09 07:29:08 UTC
(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.