From b071e5ce9abd92c6534e933823549377a9ea3f5d Mon Sep 17 00:00:00 2001 From: Fyers Date: Mon, 1 Oct 2018 23:53:14 +0200 Subject: [PATCH 1/3] use current screen location for ImageViewer --- ShareX.HelpersLib/Forms/ImageViewer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ShareX.HelpersLib/Forms/ImageViewer.cs b/ShareX.HelpersLib/Forms/ImageViewer.cs index fda4acb9f..e84156b43 100644 --- a/ShareX.HelpersLib/Forms/ImageViewer.cs +++ b/ShareX.HelpersLib/Forms/ImageViewer.cs @@ -39,6 +39,9 @@ private ImageViewer(Image image) screenshot = image; InitializeComponent(); Icon = ShareXResources.Icon; + var currentScreen = Screen.FromPoint(Cursor.Position); + StartPosition = FormStartPosition.CenterScreen; + Location = currentScreen.Bounds.Location; } public static void ShowImage(Image img) From ed473916df6a12a2b2852e85e888b226024507c5 Mon Sep 17 00:00:00 2001 From: Fyers Date: Tue, 2 Oct 2018 00:12:00 +0200 Subject: [PATCH 2/3] simplified current screen location for ImageViewer --- ShareX.HelpersLib/Forms/ImageViewer.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ShareX.HelpersLib/Forms/ImageViewer.cs b/ShareX.HelpersLib/Forms/ImageViewer.cs index e84156b43..34070569c 100644 --- a/ShareX.HelpersLib/Forms/ImageViewer.cs +++ b/ShareX.HelpersLib/Forms/ImageViewer.cs @@ -39,9 +39,6 @@ private ImageViewer(Image image) screenshot = image; InitializeComponent(); Icon = ShareXResources.Icon; - var currentScreen = Screen.FromPoint(Cursor.Position); - StartPosition = FormStartPosition.CenterScreen; - Location = currentScreen.Bounds.Location; } public static void ShowImage(Image img) @@ -127,12 +124,13 @@ private void InitializeComponent() this.SuspendLayout(); this.BackColor = SystemColors.Window; - this.Bounds = CaptureHelpers.GetScreenBounds(); + this.Bounds = CaptureHelpers.GetActiveScreenBounds(); this.DoubleBuffered = true; this.FormBorderStyle = FormBorderStyle.None; this.Text = "ShareX - Image viewer"; this.TopMost = true; this.WindowState = FormWindowState.Maximized; + this.StartPosition = FormStartPosition.CenterScreen; this.pbPreview.Cursor = Cursors.Hand; this.pbPreview.Dock = System.Windows.Forms.DockStyle.Fill; From 84773455d0f9a3bd556f07b0f47eb1338848eb87 Mon Sep 17 00:00:00 2001 From: Fyers Date: Tue, 2 Oct 2018 00:15:23 +0200 Subject: [PATCH 3/3] changed start position to manual --- ShareX.HelpersLib/Forms/ImageViewer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShareX.HelpersLib/Forms/ImageViewer.cs b/ShareX.HelpersLib/Forms/ImageViewer.cs index 34070569c..f6f9d0623 100644 --- a/ShareX.HelpersLib/Forms/ImageViewer.cs +++ b/ShareX.HelpersLib/Forms/ImageViewer.cs @@ -129,8 +129,8 @@ private void InitializeComponent() this.FormBorderStyle = FormBorderStyle.None; this.Text = "ShareX - Image viewer"; this.TopMost = true; - this.WindowState = FormWindowState.Maximized; - this.StartPosition = FormStartPosition.CenterScreen; + this.WindowState = FormWindowState.Normal; + this.StartPosition = FormStartPosition.Manual; this.pbPreview.Cursor = Cursors.Hand; this.pbPreview.Dock = System.Windows.Forms.DockStyle.Fill;