Skip to content

Commit 6dccb75

Browse files
committed
Config.MainFormMouseCaptureForcesTopmost (config -> display -> window)
useful when some obscure window can overlay bizhawk while in mouse capture mode if the hidden mouse pointer is too close to it (pop-up panel on the edge of the screen in my case). topmost+fullscreen makes those unreachable, but automatic topmost is set to false since normally it's potentially bad
1 parent f3847c8 commit 6dccb75

File tree

5 files changed

+1155
-1124
lines changed

5 files changed

+1155
-1124
lines changed

src/BizHawk.Client.Common/config/Config.cs

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public void SetWindowScaleFor(string sysID, int windowScale)
169169
public string UpdateIgnoreVersion { get; set; } = "";
170170
public bool SkipOutdatedOsCheck { get; set; }
171171
public bool CaptureMouse { get; set; } = false;
172+
public bool MainFormMouseCaptureForcesTopmost { get; set; } = false;
172173

173174
public bool SkipSuperuserPrivsCheck { get; set; }
174175

src/BizHawk.Client.EmuHawk/MainForm.cs

+10
Original file line numberDiff line numberDiff line change
@@ -4910,13 +4910,23 @@ private void CaptureMouse(bool wantCapture)
49104910
_presentationPanel.Control.Cursor = Properties.Resources.BlankCursor;
49114911
_cursorHidden = true;
49124912
BringToFront();
4913+
4914+
if (Config.MainFormMouseCaptureForcesTopmost)
4915+
{
4916+
TopMost = true;
4917+
}
49134918
}
49144919
else
49154920
{
49164921
Cursor.Clip = Rectangle.Empty;
49174922
Cursor.Show();
49184923
_presentationPanel.Control.Cursor = Cursors.Default;
49194924
_cursorHidden = false;
4925+
4926+
if (Config.MainFormMouseCaptureForcesTopmost)
4927+
{
4928+
TopMost = Config.MainFormStayOnTop;
4929+
}
49204930
}
49214931

49224932
// Cursor.Clip is a no-op on Linux, so we need this too

0 commit comments

Comments
 (0)