Skip to content

Commit

Permalink
fix(windows): Window::request_user_attention not taking effect afte…
Browse files Browse the repository at this point in the history
…r minimizing the window by clicking the taskbar icon (#947)
  • Loading branch information
muwoo committed Jun 28, 2024
1 parent f54cc11 commit b7dab73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-user-attention-minimized.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

Fix `Window::request_user_attention` not taking effect after minimizing the window by clicking the taskbar icon
8 changes: 7 additions & 1 deletion src/platform_impl/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,13 @@ impl Window {
let window = self.window.clone();
let active_window_handle = unsafe { GetActiveWindow() };
if window.0 == active_window_handle {
return;
// active window could be minimized, so we skip requesting attention
// if it is not minimized
let window_flags = self.window_state.lock().window_flags();
let is_minimized = window_flags.contains(WindowFlags::MINIMIZED);
if !is_minimized {
return;
}
}

self.thread_executor.execute_in_thread(move || unsafe {
Expand Down

0 comments on commit b7dab73

Please sign in to comment.