Skip to main content

restore_if_minimized

Function restore_if_minimized 

fn restore_if_minimized<W: WindowsApi>(
    windows_api: &W,
    window_handle: HWND,
    with_keyboard_focus: bool,
)
Expand description

Restore window_handle if its current placement reports minimized.

Silently does nothing when the placement query fails or the window is not minimized. Used by defer_windows so both client and daemon windows are brought back from the taskbar before z-order updates.

ยงArguments

  • windows_api - Windows API implementation.
  • window_handle - Handle to the window to potentially restore.
  • with_keyboard_focus - Whether the restored window should be activated. Pass false for client windows so unminimizing them does not steal foreground from the daemon - SW_RESTORE activates, which would let the last-restored client win the foreground race and block WindowsApi::bring_window_to_top from refocusing the daemon.