Windows weirdness: MouseUp event is not guaranteed to be raised.

This commit is contained in:
SuuperW 2025-06-07 13:45:23 -05:00
parent 68f7824f91
commit 850d3c58a5
2 changed files with 14 additions and 1 deletions

View File

@ -1180,6 +1180,7 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(200, 148);
this.Name = "TAStudio";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Deactivate += new System.EventHandler(this.TAStudio_Deactivate);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Tastudio_Closing);
this.Load += new System.EventHandler(this.Tastudio_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragDrop);

View File

@ -1004,7 +1004,19 @@ namespace BizHawk.Client.EmuHawk
private void TAStudio_MouseLeave(object sender, EventArgs e)
{
toolTip1.SetToolTip(TasView, null);
DoTriggeredAutoRestoreIfNeeded();
}
private void TAStudio_Deactivate(object sender, EventArgs e)
{
if (_leftButtonHeld)
{
TasView_MouseUp(this, new(MouseButtons.Left, 0, 0, 0, 0));
}
if (_rightClickFrame != -1)
{
_suppressContextMenu = true;
TasView_MouseUp(this, new(MouseButtons.Right, 0, 0, 0, 0));
}
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)