Skip to content

Commit

Permalink
修复开启鼠标穿透后抢占焦点的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
noberumotto committed Apr 29, 2020
1 parent 9149995 commit d2cc86a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Local/Project1.UI/Controls/Project1UIWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,6 @@ public Project1UIWindow()
var intPtr = new WindowInteropHelper(this).Handle;//获取当前窗口的句柄
var screen = System.Windows.Forms.Screen.FromHandle(intPtr);//获取当前屏幕
ScreenArea = screen.Bounds;

//如果开启了鼠标穿透则不抢占焦点
ShowActivated = !IsThruWindow;

}

///// <summary>
Expand Down Expand Up @@ -749,6 +745,8 @@ private void CompletedAction(CompletedActionType completedAction)
Hide();
break;
case CompletedActionType.Show:
//如果开启了鼠标穿透则不抢占焦点
ShowActivated = !IsThruWindow;
Show();
break;
}
Expand Down
5 changes: 4 additions & 1 deletion src/Local/ProjectEye/ViewModels/TipViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ private void TipViewModel_ChangedEvent()
private void TipViewModel_OnWShow(object sender, EventArgs e)
{
UpdateVariable();
WindowInstance.Focus();
if (!config.options.Style.IsThruTipWindow)
{
WindowInstance.Focus();
}
HandleAutoAction();
}

Expand Down

0 comments on commit d2cc86a

Please sign in to comment.