Debugger: Fixed debugger window being brought to front after tooltip closes even though it was in the background before the tooltip was shown
This commit is contained in:
parent
2b41a15941
commit
e2b9a7aa8e
3 changed files with 15 additions and 2 deletions
|
@ -59,10 +59,13 @@ namespace Mesen.GUI.Debugger
|
|||
public void Close()
|
||||
{
|
||||
if(_codeTooltip != null) {
|
||||
bool restoreFocus = _codeTooltip.NeedRestoreFocus;
|
||||
_codeTooltip.Close();
|
||||
_codeTooltip = null;
|
||||
if(restoreFocus) {
|
||||
_owner.Focus();
|
||||
}
|
||||
_codeTooltip = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void DisplayAddressTooltip(string word, UInt32 address)
|
||||
|
|
|
@ -211,12 +211,15 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
{
|
||||
base.OnMouseLeave(e);
|
||||
if(_codeTooltip != null) {
|
||||
bool restoreFocus = _codeTooltip.NeedRestoreFocus;
|
||||
_codeTooltip.Close();
|
||||
if(restoreFocus) {
|
||||
this.Parent.Focus();
|
||||
}
|
||||
_codeTooltip = null;
|
||||
}
|
||||
_lastPreviewScrollPosition = -1;
|
||||
_tmrScroll.Stop();
|
||||
this.Parent.Focus();
|
||||
}
|
||||
|
||||
private int HighlightHeight { get { return Math.Max(8, (int)(((float)this.VisibleLineCount / this.Maximum) * this.Height)); } }
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Mesen.GUI.Debugger
|
|||
{
|
||||
protected Form _parentForm;
|
||||
private Point _requestedLocation;
|
||||
private bool _parentContainedFocus = false;
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
|
@ -31,11 +32,17 @@ namespace Mesen.GUI.Debugger
|
|||
}
|
||||
}
|
||||
|
||||
public bool NeedRestoreFocus
|
||||
{
|
||||
get { return _parentContainedFocus; }
|
||||
}
|
||||
|
||||
public void SetFormLocation(Point screenLocation, Control focusTarget)
|
||||
{
|
||||
_requestedLocation = _parentForm.PointToClient(screenLocation);
|
||||
|
||||
if(!this.Visible) {
|
||||
this._parentContainedFocus = focusTarget.ContainsFocus;
|
||||
this.Location = _requestedLocation;
|
||||
this.Show();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue