From b517e4eafd5a1f504046aa6f957a5b4d00570206 Mon Sep 17 00:00:00 2001 From: Souryo Date: Fri, 26 May 2017 07:34:27 -0400 Subject: [PATCH] UI: Proper fix for flashing game selection screen --- GUI.NET/Controls/ctrlRecentGames.cs | 5 +++++ GUI.NET/Forms/frmMain.cs | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/GUI.NET/Controls/ctrlRecentGames.cs b/GUI.NET/Controls/ctrlRecentGames.cs index 9bff4129..a5adc92c 100644 --- a/GUI.NET/Controls/ctrlRecentGames.cs +++ b/GUI.NET/Controls/ctrlRecentGames.cs @@ -54,6 +54,11 @@ namespace Mesen.GUI.Controls base.OnVisibleChanged(e); } + public int GameCount + { + get { return _recentGames.Count; } + } + public void Initialize() { _recentGames = new List(); diff --git a/GUI.NET/Forms/frmMain.cs b/GUI.NET/Forms/frmMain.cs index 34a4c3b6..9bd4ef9f 100644 --- a/GUI.NET/Forms/frmMain.cs +++ b/GUI.NET/Forms/frmMain.cs @@ -665,12 +665,8 @@ namespace Mesen.GUI.Forms this.BeginInvoke((MethodInvoker)(() => this.UpdateMenus())); } else { panelInfo.Visible = _emuThread == null; + ctrlRecentGames.Visible = ctrlRecentGames.GameCount > 0 && _emuThread == null; mnuPowerOff.Enabled = _emuThread != null; - if(ctrlRecentGames.Visible && _emuThread == null) { - ctrlRecentGames.Visible = false; - } else { - ctrlRecentGames.Visible = true; - } ctrlLoading.Visible = (_romLoadCounter > 0);