From 72f01321ae8b02993fe681e1c14bded4cc4105cc Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:20:05 +0200 Subject: [PATCH] Main window position tweak #2983 --- app/Program.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Program.cs b/app/Program.cs index 302fc24e..6de7d008 100644 --- a/app/Program.cs +++ b/app/Program.cs @@ -282,15 +282,17 @@ namespace GHelper } else { - var screen = Screen.FromControl(settingsForm); + var screen = Screen.PrimaryScreen; + if (screen is null) screen = Screen.FromControl(settingsForm); - settingsForm.Left = screen.WorkingArea.X + screen.WorkingArea.Width - 10 - settingsForm.Width; + settingsForm.Location = screen.WorkingArea.Location; + settingsForm.Left = screen.WorkingArea.Width - 10 - settingsForm.Width; settingsForm.Top = screen.WorkingArea.Height - 10 - settingsForm.Height; settingsForm.Show(); settingsForm.Activate(); - settingsForm.Left = screen.WorkingArea.X + screen.WorkingArea.Width - 10 - settingsForm.Width; + settingsForm.Left = screen.WorkingArea.Width - 10 - settingsForm.Width; if (AppConfig.IsAlly()) settingsForm.Top = Math.Max(10, screen.Bounds.Height - 110 - settingsForm.Height);