Skip to content

Commit

Permalink
Merge pull request HearthSim#1326 from dpedigo/master
Browse files Browse the repository at this point in the history
Better fix for the alt tab issue (issue HearthSim#1321)
  • Loading branch information
Epix committed Aug 26, 2015
2 parents bf18b12 + 76d9868 commit e7daca8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Hearthstone Deck Tracker/MainWindow/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
MinHeight="584" MinWidth="700"
Closing="Window_Closing"
Icon="..\Images\HearthstoneDeckTracker.ico"
StateChanged="MetroWindow_StateChanged" Loaded="MetroWindow_Loaded"
StateChanged="MetroWindow_StateChanged" Loaded="MetroWindow_Loaded" SourceInitialized="MetroWindow_SourceInitalized"
BorderBrush="{DynamicResource AccentColorBrush}" BorderThickness="1" LocationChanged="MetroWindow_LocationChanged" SizeChanged="MetroWindow_SizeChanged">
<Window.Resources>
<ResourceDictionary>
Expand Down
8 changes: 8 additions & 0 deletions Hearthstone Deck Tracker/MainWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,14 @@ private void MetroWindow_StateChanged(object sender, EventArgs e)
MinimizeToTray();
}

private void MetroWindow_SourceInitalized(object sender, EventArgs e)
{
// we need to take ownership of the overlay to prevent it from appearing
// in the alt+tab switcher but we also need a valid window handle.
// this is the soonest we'll have one.
Overlay.Owner = this;
}

private async void Window_Closing(object sender, CancelEventArgs e)
{
try
Expand Down
2 changes: 1 addition & 1 deletion Hearthstone Deck Tracker/Windows/OverlayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ private void ReSizePosLists()
private void Window_SourceInitialized_1(object sender, EventArgs e)
{
var hwnd = new WindowInteropHelper(this).Handle;
User32.SetWindowExStyle(hwnd, User32.WsExTransparent | User32.WsExToolWindow);
User32.SetWindowExStyle(hwnd, User32.WsExTransparent);
}

public void Update(bool refresh)
Expand Down

0 comments on commit e7daca8

Please sign in to comment.