mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
fix: 修复特殊情况下背景绘制不正确的问题
This commit is contained in:
parent
dc3a6ae139
commit
95aeb6691c
10 changed files with 97 additions and 24 deletions
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
|
||||
using namespace winrt;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
|
||||
|
|
@ -54,7 +55,25 @@ void App::OnClose() {
|
|||
bool App::Initialize(Magpie::Settings settings, uint64_t hwndHost) {
|
||||
_settings = settings;
|
||||
_hwndHost = hwndHost;
|
||||
_isHostWndFocused = GetForegroundWindow() == (HWND)hwndHost;
|
||||
return true;
|
||||
}
|
||||
|
||||
event_token App::HostWndFocusChanged(EventHandler<bool> const& handler) {
|
||||
return _hostWndFocusChangedEvent.add(handler);
|
||||
}
|
||||
|
||||
void App::HostWndFocusChanged(event_token const& token) noexcept {
|
||||
_hostWndFocusChangedEvent.remove(token);
|
||||
}
|
||||
|
||||
void App::OnHostWndFocusChanged(bool isFocused) {
|
||||
if (isFocused == _isHostWndFocused) {
|
||||
return;
|
||||
}
|
||||
|
||||
_isHostWndFocused = isFocused;
|
||||
_hostWndFocusChangedEvent(*this, isFocused);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue