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 770426 - Moving the "Resume" dialog unpauses the game
Moving the "Resume" dialog unpauses the game
Status: RESOLVED FIXED
Product: gnome-games
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-26 05:36 UTC by Adrien Plazas
Modified: 2016-09-02 23:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ui: Delay pausing the game on focus change (3.09 KB, patch)
2016-09-02 09:15 UTC, Adrien Plazas
committed Details | Review
ui: Instantanously pause on toplevel focus completely lost (936 bytes, patch)
2016-09-02 09:15 UTC, Adrien Plazas
committed Details | Review
ui: Check 'Resume' dialog before updating the pause (1.42 KB, patch)
2016-09-02 09:16 UTC, Adrien Plazas
committed Details | Review
ui: Check 'Quit' dialog before updating the pause (1.51 KB, patch)
2016-09-02 09:16 UTC, Adrien Plazas
committed Details | Review

Description Adrien Plazas 2016-08-26 05:36:58 UTC
When moving the window by dragging the "Resume" dialog in GNOME Shell, the game is unpaused during the drag then paused again.
Comment 1 Bastien Nocera 2016-08-26 12:03:14 UTC
Maybe moving away should just pause the game, and show "resume" dialogue, so it doesn't automatically restart.

Also note that using the volume keys, or any other global keybindings in X11 will unfocus the window, before refocusing it, so maybe a 1 sec timeout is better than doing this straight away?
Comment 2 Adrien Plazas 2016-08-27 17:46:32 UTC
The whole "pause/resume the game when the window is [un]focused" implementation is half-baked, what about dropping it for 3.22?
Comment 3 Mathieu Bridon 2016-08-28 10:08:23 UTC
> Also note that using the volume keys, or any other global keybindings in X11 will unfocus the window, before refocusing it, so maybe a 1 sec timeout is better than doing this straight away?

That's what I had found as well, and it's very jarring when the sound keeps cutting because you're adjusting the volume.

I'd have gone with an even longer timeout personally, maybe 4 or 5 seconds, because even mousing over a notification bubble (not clicking it) to expand and see its body currently pauses the game. Letting the player quickly review a notification for a few seconds without pausing would be better I think.

But that's a different bug report from the original comment.

> The whole "pause/resume the game when the window is [un]focused" implementation is half-baked, what about dropping it for 3.22?

That won't fix the problem reported here, and it is a useful feature, it just needs a bit more work. :)
Comment 4 Adrien Plazas 2016-09-02 09:15:49 UTC
Created attachment 334626 [details] [review]
ui: Delay pausing the game on focus change

Add a 500 milliseconds delay before pausing the game when the
application lost the focus.

This avoids annoying pauses when the shell briefly takes the focus (when
changing the sound volume for example) while avoiding to loose control
of the game for too long.
Comment 5 Adrien Plazas 2016-09-02 09:15:58 UTC
Created attachment 334627 [details] [review]
ui: Instantanously pause on toplevel focus completely lost

Avoid the 500 milliseconds delay before pausing when the toplevel focus
is completely lost.
Comment 6 Adrien Plazas 2016-09-02 09:16:09 UTC
Created attachment 334628 [details] [review]
ui: Check 'Resume' dialog before updating the pause

Check that there is no 'Resume' dialog before updating the pause when
the toplevel focus changes.

This avoids unpausing the game when dragging the dialog.
Comment 7 Adrien Plazas 2016-09-02 09:16:18 UTC
Created attachment 334629 [details] [review]
ui: Check 'Quit' dialog before updating the pause

Check that there is no 'Quit' dialog before updating the pause when the
toplevel focus changes.

This avoids unpausing the game when dragging the dialog.
Comment 8 Adrien Plazas 2016-09-02 23:45:59 UTC
Attachment 334626 [details] pushed as 2a925ff - ui: Delay pausing the game on focus change
Attachment 334627 [details] pushed as c71e3ee - ui: Instantanously pause on toplevel focus completely lost
Attachment 334628 [details] pushed as 7c7f769 - ui: Check 'Resume' dialog before updating the pause
Attachment 334629 [details] pushed as ce9cafa - ui: Check 'Quit' dialog before updating the pause