Skip to content

Commit

Permalink
Try to ensure window appears on top when started
Browse files Browse the repository at this point in the history
  • Loading branch information
simshaun committed May 8, 2020
1 parent 5772024 commit 53b2dd8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion PixelPalette/Window/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -569,6 +568,15 @@ public MainWindow()
Debug.WriteLine($"b*: {value}");
_vm.RefreshFromLab(_vm.Lab.WithB(value));
});

// Hack to bring window to front on start. (I had instances where I would open the tool
// only for it to come up behind my current window.)
if (!IsVisible) Show();
WindowState = WindowState.Normal;
Activate();
Topmost = true;
Topmost = false;
Focus();
}

private void StartEyedropper()
Expand Down

0 comments on commit 53b2dd8

Please sign in to comment.