GNOME Bugzilla – Bug 770426
Moving the "Resume" dialog unpauses the game
Last modified: 2016-09-02 23:46:44 UTC
When moving the window by dragging the "Resume" dialog in GNOME Shell, the game is unpaused during the drag then paused again.
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?
The whole "pause/resume the game when the window is [un]focused" implementation is half-baked, what about dropping it for 3.22?
> 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. :)
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.
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.
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.
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.
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