From 9b9a006dcbf7a414329e370b844b3840c6e550ee Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Wed, 4 Apr 2018 01:05:54 +0300 Subject: [PATCH] '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; }