Skip to content

Commit 3cfe122

Browse files
committed
Use new MonitorInfo class class
1 parent 4f423c4 commit 3cfe122

File tree

6 files changed

+8
-2
lines changed

6 files changed

+8
-2
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.Windows.Markup;
1414
using System.Windows.Media;
1515
using Flow.Launcher.Infrastructure.UserSettings;
16+
using Flow.Launcher.Plugin.SharedModels;
1617
using Microsoft.Win32;
1718
using Microsoft.Win32.SafeHandles;
1819
using Windows.Win32;

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using Flow.Launcher.Infrastructure.UserSettings;
2424
using Flow.Launcher.Plugin;
2525
using Flow.Launcher.Plugin.SharedCommands;
26+
using Flow.Launcher.Plugin.SharedModels;
2627
using Flow.Launcher.ViewModel;
2728
using Microsoft.Win32;
2829
using ModernWpf.Controls;

Flow.Launcher/Msg.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Windows.Input;
55
using System.Windows.Media.Animation;
66
using Flow.Launcher.Infrastructure;
7+
using Flow.Launcher.Plugin.SharedModels;
78

89
namespace Flow.Launcher
910
{

Flow.Launcher/MsgWithButton.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Windows.Input;
55
using System.Windows.Media.Animation;
66
using Flow.Launcher.Infrastructure;
7+
using Flow.Launcher.Plugin.SharedModels;
78

89
namespace Flow.Launcher
910
{

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using CommunityToolkit.Mvvm.DependencyInjection;
88
using Flow.Launcher.Infrastructure;
99
using Flow.Launcher.Infrastructure.UserSettings;
10+
using Flow.Launcher.Plugin.SharedModels;
1011
using Flow.Launcher.SettingPages.Views;
1112
using Flow.Launcher.ViewModel;
1213
using ModernWpf.Controls;

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Flow.Launcher.Plugin.Explorer.Search.Everything;
88
using Flow.Launcher.Plugin.Explorer.Views;
99
using Flow.Launcher.Plugin.SharedCommands;
10+
using Flow.Launcher.Plugin.SharedModels;
1011
using Peter;
1112
using Path = System.IO.Path;
1213

@@ -72,10 +73,10 @@ public static Result CreateResult(Query query, SearchResult result)
7273

7374
internal static void ShowNativeContextMenu(string path, ResultType type)
7475
{
75-
var screenWithMouseCursor = System.Windows.Forms.Screen.FromPoint(System.Windows.Forms.Cursor.Position);
76+
var screenWithMouseCursor = MonitorInfo.GetCursorDisplayMonitor();
7677
var xOfScreenCenter = screenWithMouseCursor.WorkingArea.Left + screenWithMouseCursor.WorkingArea.Width / 2;
7778
var yOfScreenCenter = screenWithMouseCursor.WorkingArea.Top + screenWithMouseCursor.WorkingArea.Height / 2;
78-
var showPosition = new System.Drawing.Point(xOfScreenCenter, yOfScreenCenter);
79+
var showPosition = new System.Drawing.Point((int)xOfScreenCenter, (int)yOfScreenCenter);
7980

8081
switch (type)
8182
{

0 commit comments

Comments
 (0)