mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use new MonitorInfo class class
This commit is contained in:
parent
4f423c47cd
commit
3cfe122c7b
6 changed files with 8 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ using System.Windows.Interop;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Flow.Launcher.Infrastructure.UserSettings;
|
using Flow.Launcher.Infrastructure.UserSettings;
|
||||||
|
using Flow.Launcher.Plugin.SharedModels;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using Microsoft.Win32.SafeHandles;
|
using Microsoft.Win32.SafeHandles;
|
||||||
using Windows.Win32;
|
using Windows.Win32;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ using Flow.Launcher.Infrastructure.DialogJump;
|
||||||
using Flow.Launcher.Infrastructure.UserSettings;
|
using Flow.Launcher.Infrastructure.UserSettings;
|
||||||
using Flow.Launcher.Plugin;
|
using Flow.Launcher.Plugin;
|
||||||
using Flow.Launcher.Plugin.SharedCommands;
|
using Flow.Launcher.Plugin.SharedCommands;
|
||||||
|
using Flow.Launcher.Plugin.SharedModels;
|
||||||
using Flow.Launcher.ViewModel;
|
using Flow.Launcher.ViewModel;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using ModernWpf.Controls;
|
using ModernWpf.Controls;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using Flow.Launcher.Infrastructure;
|
using Flow.Launcher.Infrastructure;
|
||||||
|
using Flow.Launcher.Plugin.SharedModels;
|
||||||
|
|
||||||
namespace Flow.Launcher
|
namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using Flow.Launcher.Infrastructure;
|
using Flow.Launcher.Infrastructure;
|
||||||
|
using Flow.Launcher.Plugin.SharedModels;
|
||||||
|
|
||||||
namespace Flow.Launcher
|
namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using System.Windows.Interop;
|
||||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
using Flow.Launcher.Infrastructure;
|
using Flow.Launcher.Infrastructure;
|
||||||
using Flow.Launcher.Infrastructure.UserSettings;
|
using Flow.Launcher.Infrastructure.UserSettings;
|
||||||
|
using Flow.Launcher.Plugin.SharedModels;
|
||||||
using Flow.Launcher.SettingPages.Views;
|
using Flow.Launcher.SettingPages.Views;
|
||||||
using Flow.Launcher.ViewModel;
|
using Flow.Launcher.ViewModel;
|
||||||
using ModernWpf.Controls;
|
using ModernWpf.Controls;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using System.Windows.Input;
|
||||||
using Flow.Launcher.Plugin.Explorer.Search.Everything;
|
using Flow.Launcher.Plugin.Explorer.Search.Everything;
|
||||||
using Flow.Launcher.Plugin.Explorer.Views;
|
using Flow.Launcher.Plugin.Explorer.Views;
|
||||||
using Flow.Launcher.Plugin.SharedCommands;
|
using Flow.Launcher.Plugin.SharedCommands;
|
||||||
|
using Flow.Launcher.Plugin.SharedModels;
|
||||||
using Peter;
|
using Peter;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
|
||||||
|
|
@ -72,10 +73,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
|
|
||||||
internal static void ShowNativeContextMenu(string path, ResultType type)
|
internal static void ShowNativeContextMenu(string path, ResultType type)
|
||||||
{
|
{
|
||||||
var screenWithMouseCursor = System.Windows.Forms.Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
var screenWithMouseCursor = MonitorInfo.GetCursorDisplayMonitor();
|
||||||
var xOfScreenCenter = screenWithMouseCursor.WorkingArea.Left + screenWithMouseCursor.WorkingArea.Width / 2;
|
var xOfScreenCenter = screenWithMouseCursor.WorkingArea.Left + screenWithMouseCursor.WorkingArea.Width / 2;
|
||||||
var yOfScreenCenter = screenWithMouseCursor.WorkingArea.Top + screenWithMouseCursor.WorkingArea.Height / 2;
|
var yOfScreenCenter = screenWithMouseCursor.WorkingArea.Top + screenWithMouseCursor.WorkingArea.Height / 2;
|
||||||
var showPosition = new System.Drawing.Point(xOfScreenCenter, yOfScreenCenter);
|
var showPosition = new System.Drawing.Point((int)xOfScreenCenter, (int)yOfScreenCenter);
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue