Skip to content

Commit

Permalink
Resolves #185
Browse files Browse the repository at this point in the history
- Force the focus indicator to the back.
- Prevent the focus indicator from being focused
  • Loading branch information
dalyIsaac committed Oct 15, 2022
1 parent 4b2ef14 commit f895ff0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Whim.FocusIndicator/FocusIndicatorWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Whim.FocusIndicator;
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.UI.WindowsAndMessaging;

namespace Whim.FocusIndicator;

/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
Expand Down Expand Up @@ -33,9 +37,13 @@ public void Activate(IWindowState windowLocation)
);

this.SetIsShownInSwitchers(false);

// Prevent the window from being activated.
_ = PInvoke.SetWindowLong(this.GetHandle(), WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (int)WINDOW_EX_STYLE.WS_EX_NOACTIVATE);

WindowDeferPosHandle.SetWindowPos(
new WindowState(_window, borderLocation, WindowSize.Normal),
windowLocation.Window.Handle
new HWND(1)
);
}
}

0 comments on commit f895ff0

Please sign in to comment.