From 13871ec3e8ecda4a6d831433bc9327e0d4e7f356 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Tue, 3 Apr 2018 23:33:38 +0300 Subject: [PATCH 1/8] Updated version to 4.0.1 --- Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs | 2 +- Eve-O-Preview/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs b/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs index e4fa52e..18a70c1 100644 --- a/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs +++ b/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs @@ -232,7 +232,7 @@ namespace EveOPreview.Presenters private string GetApplicationVersion() { Version version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version; - return $"{version.Major}.{version.Minor}.{version.Revision}"; + return $"{version.Major}.{version.Minor}.{version.Build}"; } private void ExitApplication() diff --git a/Eve-O-Preview/Properties/AssemblyInfo.cs b/Eve-O-Preview/Properties/AssemblyInfo.cs index 0867608..363b1d9 100644 --- a/Eve-O-Preview/Properties/AssemblyInfo.cs +++ b/Eve-O-Preview/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")] -[assembly: AssemblyVersion("4.0.0.0")] -[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyVersion("4.0.1.0")] +[assembly: AssemblyFileVersion("4.0.1.0")] [assembly: CLSCompliant(false)] \ No newline at end of file From f9cbf239f5375d5a9bfec53c5b912d973d469687 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Tue, 3 Apr 2018 23:35:29 +0300 Subject: [PATCH 2/8] Option "Hide previews when EVE client is not active" does not work --- Eve-O-Preview/Services/Implementation/ThumbnailManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs b/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs index 1fe7862..d14e7e7 100644 --- a/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs +++ b/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs @@ -198,7 +198,7 @@ namespace EveOPreview.Services this.SwitchActiveClient(foregroundWindowHandle, foregroundWindowTitle); } - bool hideAllThumbnails = this._configuration.HideThumbnailsOnLostFocus && !(string.IsNullOrEmpty(foregroundWindowTitle) || this.IsClientWindowActive(foregroundWindowHandle)); + bool hideAllThumbnails = this._configuration.HideThumbnailsOnLostFocus && !this.IsClientWindowActive(foregroundWindowHandle); this._refreshCycleCount++; From 6fccd9ff4d9803cdb0885c034e88929b852dc4a7 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Tue, 3 Apr 2018 23:37:54 +0300 Subject: [PATCH 3/8] Thumbnail can fall behind other windows even if the 'Stay on top' option is activated --- Eve-O-Preview/View/Implementation/ThumbnailView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eve-O-Preview/View/Implementation/ThumbnailView.cs b/Eve-O-Preview/View/Implementation/ThumbnailView.cs index b4cdb8b..238196e 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailView.cs @@ -176,12 +176,12 @@ namespace EveOPreview.View public void SetTopMost(bool enableTopmost) { - // IMO WinForms could check this too if (this._isTopMost == enableTopmost) { return; } + this.TopLevel = enableTopmost; this.TopMost = enableTopmost; this._overlay.TopMost = enableTopmost; From 016b3f7343ade95f610eb3587c5f7ebfcec2a550 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Tue, 3 Apr 2018 23:46:21 +0300 Subject: [PATCH 4/8] Major bug: Thumbnails can get resized randomly when placed on displays with different DPI --- .../ThumbnailOverlay.Designer.cs | 2 +- .../Implementation/ThumbnailView.Designer.cs | 2 +- .../View/Implementation/ThumbnailView.cs | 26 +++++++++++++++---- Eve-O-Preview/app.manifest | 1 + 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs b/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs index a089ab4..b1668ae 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs @@ -61,7 +61,7 @@ // ThumbnailOverlay // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(284, 262); this.ControlBox = false; diff --git a/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs b/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs index 2271a94..c0540fd 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs @@ -20,7 +20,7 @@ namespace EveOPreview.View // this.AccessibleRole = System.Windows.Forms.AccessibleRole.None; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(153, 89); this.ControlBox = false; diff --git a/Eve-O-Preview/View/Implementation/ThumbnailView.cs b/Eve-O-Preview/View/Implementation/ThumbnailView.cs index 238196e..5426fcf 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailView.cs @@ -9,6 +9,10 @@ namespace EveOPreview.View { public partial class ThumbnailView : Form, IThumbnailView { + #region Private constants + private const int ResizeEventTimeout = 500; + #endregion + #region Private fields private readonly IWindowManager _windowManager; private readonly ThumbnailOverlay _overlay; @@ -34,6 +38,8 @@ namespace EveOPreview.View public ThumbnailView(IWindowManager windowManager) { + this.SuppressResizeEvent(); + this._windowManager = windowManager; this.IsActive = false; @@ -48,8 +54,6 @@ namespace EveOPreview.View this._isHighlightEnabled = false; - this._suppressResizeEventsTimestamp = DateTime.UtcNow; - InitializeComponent(); this._overlay = new ThumbnailOverlay(this, this.MouseDown_Handler); @@ -104,6 +108,8 @@ namespace EveOPreview.View public new void Show() { + this.SuppressResizeEvent(); + base.Show(); this._isLocationChanged = true; @@ -118,6 +124,8 @@ namespace EveOPreview.View public new void Hide() { + this.SuppressResizeEvent(); + this.IsActive = false; this._overlay.Hide(); @@ -126,6 +134,8 @@ namespace EveOPreview.View public new void Close() { + this.SuppressResizeEvent(); + this.IsActive = false; this._thumbnail?.Unregister(); this._overlay.Close(); @@ -165,9 +175,8 @@ namespace EveOPreview.View return; } - // Fix for WinForms issue with the Resize event being fired with inconsistent ClientSize value - // Any Resize events fired before this timestamp will be ignored - this._suppressResizeEventsTimestamp = DateTime.UtcNow.AddMilliseconds(450); + this.SuppressResizeEvent(); + this.FormBorderStyle = style; // Notify about possible contents position change @@ -384,6 +393,13 @@ namespace EveOPreview.View this._thumbnail.Move(0 + highlightWidthLeft, 0 + this._highlightWidth, baseWidth - highlightWidthRight, baseHeight - this._highlightWidth); } + private void SuppressResizeEvent() + { + // Workaround for WinForms issue with the Resize event being fired with inconsistent ClientSize value + // Any Resize events fired before this timestamp will be ignored + this._suppressResizeEventsTimestamp = DateTime.UtcNow.AddMilliseconds(ThumbnailView.ResizeEventTimeout); + } + #region GUI events protected override CreateParams CreateParams { diff --git a/Eve-O-Preview/app.manifest b/Eve-O-Preview/app.manifest index 555d4c6..5fc7044 100644 --- a/Eve-O-Preview/app.manifest +++ b/Eve-O-Preview/app.manifest @@ -75,6 +75,7 @@ True/PM + PerMonitorV2 From 36cf3f421e412cd954524f2067a6d3d0cd408605 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Tue, 3 Apr 2018 23:47:47 +0300 Subject: [PATCH 5/8] Updated build path --- Eve-O-Preview/Eve-O-Preview.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Eve-O-Preview/Eve-O-Preview.csproj b/Eve-O-Preview/Eve-O-Preview.csproj index cf8b4be..2d0e212 100644 --- a/Eve-O-Preview/Eve-O-Preview.csproj +++ b/Eve-O-Preview/Eve-O-Preview.csproj @@ -19,7 +19,7 @@ true full false - bin\Debug\ + ..\bin DEBUG;TRACE prompt 4 @@ -30,7 +30,7 @@ pdbonly true - bin\Release\ + ..\bin TRACE prompt 4 From c9121873b5b36b4a3cdce5bd2fb0dde70c7527ae Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Tue, 3 Apr 2018 23:50:27 +0300 Subject: [PATCH 6/8] Code reorganization --- .../Configuration/{ => Implementation}/AppConfig.cs | 2 +- .../{ => Implementation}/ConfigurationStorage.cs | 2 +- .../Implementation/ThumbnailConfiguration.cs | 2 +- .../Configuration/{ => Interface}/ClientLayout.cs | 0 .../Configuration/{ => Interface}/IAppConfig.cs | 0 .../{ => Interface}/IConfigurationStorage.cs | 0 .../Configuration/{ => Interface}/ZoomAnchor.cs | 0 Eve-O-Preview/Eve-O-Preview.csproj | 12 ++++++------ 8 files changed, 9 insertions(+), 9 deletions(-) rename Eve-O-Preview/Configuration/{ => Implementation}/AppConfig.cs (71%) rename Eve-O-Preview/Configuration/{ => Implementation}/ConfigurationStorage.cs (92%) rename Eve-O-Preview/Configuration/{ => Interface}/ClientLayout.cs (100%) rename Eve-O-Preview/Configuration/{ => Interface}/IAppConfig.cs (100%) rename Eve-O-Preview/Configuration/{ => Interface}/IConfigurationStorage.cs (100%) rename Eve-O-Preview/Configuration/{ => Interface}/ZoomAnchor.cs (100%) diff --git a/Eve-O-Preview/Configuration/AppConfig.cs b/Eve-O-Preview/Configuration/Implementation/AppConfig.cs similarity index 71% rename from Eve-O-Preview/Configuration/AppConfig.cs rename to Eve-O-Preview/Configuration/Implementation/AppConfig.cs index c059d39..daa7de0 100644 --- a/Eve-O-Preview/Configuration/AppConfig.cs +++ b/Eve-O-Preview/Configuration/Implementation/AppConfig.cs @@ -1,4 +1,4 @@ -namespace EveOPreview.Configuration +namespace EveOPreview.Configuration.Implementation { class AppConfig : IAppConfig { diff --git a/Eve-O-Preview/Configuration/ConfigurationStorage.cs b/Eve-O-Preview/Configuration/Implementation/ConfigurationStorage.cs similarity index 92% rename from Eve-O-Preview/Configuration/ConfigurationStorage.cs rename to Eve-O-Preview/Configuration/Implementation/ConfigurationStorage.cs index 50a0663..e07ec8f 100644 --- a/Eve-O-Preview/Configuration/ConfigurationStorage.cs +++ b/Eve-O-Preview/Configuration/Implementation/ConfigurationStorage.cs @@ -1,7 +1,7 @@ using System.IO; using Newtonsoft.Json; -namespace EveOPreview.Configuration +namespace EveOPreview.Configuration.Implementation { class ConfigurationStorage : IConfigurationStorage { diff --git a/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs b/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs index b22c926..eac17e9 100644 --- a/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs +++ b/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.Windows.Forms; using Newtonsoft.Json; -namespace EveOPreview.Configuration.Omplementation +namespace EveOPreview.Configuration.Implementation { sealed class ThumbnailConfiguration : IThumbnailConfiguration { diff --git a/Eve-O-Preview/Configuration/ClientLayout.cs b/Eve-O-Preview/Configuration/Interface/ClientLayout.cs similarity index 100% rename from Eve-O-Preview/Configuration/ClientLayout.cs rename to Eve-O-Preview/Configuration/Interface/ClientLayout.cs diff --git a/Eve-O-Preview/Configuration/IAppConfig.cs b/Eve-O-Preview/Configuration/Interface/IAppConfig.cs similarity index 100% rename from Eve-O-Preview/Configuration/IAppConfig.cs rename to Eve-O-Preview/Configuration/Interface/IAppConfig.cs diff --git a/Eve-O-Preview/Configuration/IConfigurationStorage.cs b/Eve-O-Preview/Configuration/Interface/IConfigurationStorage.cs similarity index 100% rename from Eve-O-Preview/Configuration/IConfigurationStorage.cs rename to Eve-O-Preview/Configuration/Interface/IConfigurationStorage.cs diff --git a/Eve-O-Preview/Configuration/ZoomAnchor.cs b/Eve-O-Preview/Configuration/Interface/ZoomAnchor.cs similarity index 100% rename from Eve-O-Preview/Configuration/ZoomAnchor.cs rename to Eve-O-Preview/Configuration/Interface/ZoomAnchor.cs diff --git a/Eve-O-Preview/Eve-O-Preview.csproj b/Eve-O-Preview/Eve-O-Preview.csproj index 2d0e212..abdecee 100644 --- a/Eve-O-Preview/Eve-O-Preview.csproj +++ b/Eve-O-Preview/Eve-O-Preview.csproj @@ -108,11 +108,11 @@ - - - + + + - + @@ -143,7 +143,7 @@ - + @@ -167,7 +167,7 @@ MainForm.cs - + From 9b9a006dcbf7a414329e370b844b3840c6e550ee Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Wed, 4 Apr 2018 01:05:54 +0300 Subject: [PATCH 7/8] 'Active Client Highlight' frame is displayed with noticeable delay --- .../Services/Implementation/ThumbnailManager.cs | 15 ++++++++++++--- .../View/Implementation/ThumbnailView.cs | 3 +-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs b/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs index d14e7e7..693e12d 100644 --- a/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs +++ b/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs @@ -383,11 +383,20 @@ namespace EveOPreview.Services private void ThumbnailActivated(IntPtr id) { - // View is always available because this method is actually being called by - // a view callback IThumbnailView view = this._thumbnailViews[id]; - Task.Run(() => this._windowManager.ActivateWindow(view.Id)); + Task.Run(() => + { + this._windowManager.ActivateWindow(view.Id); + }) + .ConfigureAwait(true) + .GetAwaiter() + .OnCompleted(() => + { + this.SwitchActiveClient(view.Id, view.Title); + this.UpdateClientLayouts(); + this.RefreshThumbnails(); + }); this.UpdateClientLayouts(); } diff --git a/Eve-O-Preview/View/Implementation/ThumbnailView.cs b/Eve-O-Preview/View/Implementation/ThumbnailView.cs index 5426fcf..7199707 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailView.cs @@ -116,8 +116,7 @@ namespace EveOPreview.View this._isSizeChanged = true; this._isOverlayVisible = false; - // Thumbnail will be properly registered during the Manager's Refresh cycle - this.Refresh(); + this.Refresh(true); this.IsActive = true; } From dd0604483304216ed53fc2a76edee0258845e35a Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Wed, 4 Apr 2018 01:07:43 +0300 Subject: [PATCH 8/8] Updated forum link in the 'About' tab --- Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs b/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs index 18a70c1..8d35104 100644 --- a/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs +++ b/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs @@ -12,7 +12,7 @@ namespace EveOPreview.Presenters public class MainFormPresenter : Presenter, IMainFormPresenter { #region Private constants - private const string ForumUrl = @"https://meta.eveonline.com/t/4202"; + private const string ForumUrl = @"https://forum.eveonline.com/t/4202"; #endregion #region Private fields