Linux: Fixed "In background" flag behavior
This commit is contained in:
parent
54d0f4d0a5
commit
7c11e8154a
1 changed files with 5 additions and 5 deletions
|
@ -38,6 +38,7 @@ namespace Mesen.GUI.Forms
|
|||
private bool _isNsfPlayerMode = false;
|
||||
private object _loadRomLock = new object();
|
||||
private int _romLoadCounter = 0;
|
||||
private bool _removeFocus = false;
|
||||
|
||||
private string[] _commandLineArgs;
|
||||
private bool _noAudio = false;
|
||||
|
@ -131,12 +132,14 @@ namespace Mesen.GUI.Forms
|
|||
protected override void OnDeactivate(EventArgs e)
|
||||
{
|
||||
base.OnDeactivate(e);
|
||||
_removeFocus = true;
|
||||
InteropEmu.ResetKeyState();
|
||||
}
|
||||
|
||||
protected override void OnActivated(EventArgs e)
|
||||
{
|
||||
base.OnActivated(e);
|
||||
_removeFocus = false;
|
||||
InteropEmu.ResetKeyState();
|
||||
}
|
||||
|
||||
|
@ -540,11 +543,8 @@ namespace Mesen.GUI.Forms
|
|||
}
|
||||
}
|
||||
|
||||
foreach(ToolStripItem item in menuStrip.Items) {
|
||||
if(item.Pressed || item.Selected) {
|
||||
hasFocus = false;
|
||||
break;
|
||||
}
|
||||
if(_removeFocus) {
|
||||
hasFocus = false;
|
||||
}
|
||||
|
||||
InteropEmu.SetFlag(EmulationFlags.InBackground, !hasFocus);
|
||||
|
|
Loading…
Add table
Reference in a new issue