mouse capture: restrict to center
various toolbars may exist near screen edges, we don't want them to be triggered when hawk has "captured" the mouse, especially in fullscreen. I considered taking into account when hawk window is partly offscreen but it's hard to expect anyone would play that way - normal scenario is fullscreen, so screen edges are automatically pushed away from. dialogs covering hawk are even less likely to remain during mouse capture, so we don't care about mouse appearing on them.
This commit is contained in:
parent
ca214fc4f0
commit
b0b32bea6a
|
@ -4876,9 +4876,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (wantCapture)
|
||||
{
|
||||
var size = _presentationPanel.Control.Size;
|
||||
var fbLocation = Point.Subtract(Bounds.Location, new(PointToClient(Location)));
|
||||
fbLocation.Offset(_presentationPanel.Control.Location);
|
||||
Cursor.Clip = new(fbLocation, _presentationPanel.Control.Size);
|
||||
fbLocation.Offset(new Point(size.Width / 2, size.Height / 2));
|
||||
Cursor.Clip = new(fbLocation, new(1, 1));
|
||||
Cursor.Hide();
|
||||
_presentationPanel.Control.Cursor = Properties.Resources.BlankCursor;
|
||||
_cursorHidden = true;
|
||||
|
|
Loading…
Reference in New Issue