Gtk/Wayland: Only allow one pause state change per focus change.

Check whether we've already paused for it.

Gtk/Wayland sends multiple focus_notify events with the same
state, even when it doesn't change. This occurs when popup
menus are opened and closed.
This commit is contained in:
BearOso 2024-12-09 15:32:34 -06:00
parent 9be3ed49a8
commit 2ffc66c33c
1 changed files with 1 additions and 1 deletions

View File

@ -520,7 +520,7 @@ void Snes9xWindow::focus_notify(bool state)
{
focused = state;
if (!state && config->pause_emulation_on_switch)
if (!state && config->pause_emulation_on_switch && !paused_from_focus_loss)
{
sys_pause++;
propagate_pause_state();