1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed ctrl+click Go To Definition timing issue

This commit is contained in:
Brian Fiete 2020-10-13 07:27:10 -07:00
parent 14609dc636
commit c3b697c0a4
2 changed files with 8 additions and 1 deletions

View file

@ -45,6 +45,7 @@ namespace Beefy.widgets
public bool mIsMainWindow;
public MouseFlag mMouseFlags;
public KeyFlags mMouseDownKeyFlags;
public Widget mRootWidget;
public Widget mCaptureWidget;
public Widget mOverWidget;
@ -628,6 +629,9 @@ namespace Beefy.widgets
{
let oldFlags = mMouseFlags;
if (mMouseFlags == 0)
mMouseDownKeyFlags = GetKeyFlags();
mMouseFlags |= (MouseFlag)(1 << btn);
if ((!mHasFocus) && (mParent == null))
{
@ -723,6 +727,8 @@ namespace Beefy.widgets
}
}
if (mMouseFlags == 0)
mMouseDownKeyFlags = 0;
}
public void ReleaseMouseCaptures()
@ -813,6 +819,7 @@ namespace Beefy.widgets
return;
newMouseWindow.mMouseFlags = mMouseFlags;
newMouseWindow.mMouseDownKeyFlags = mMouseDownKeyFlags;
newMouseWindow.CaptureMouse();
mMouseFlags = default;
}

View file

@ -3592,7 +3592,7 @@ namespace IDE.ui
var useX = x;
var useY = y;
if ((btn == 0) && (mWidgetWindow.IsKeyDown(.Control)) && (x == origX) && (y == origY))
if ((btn == 0) && (mWidgetWindow.mMouseDownKeyFlags.HasFlag(.Ctrl)) && (x == origX) && (y == origY))
{
gApp.GoToDefinition(false);
return;