feat(debugger): flash the taskbar when a breakpoint is hit in an unfocused window (#1810)

A breakpoint stop now grabs attention like IDEA's: the owning window's
taskbar button flashes while the window is in the background (new
window_flash_taskbar command wrapping request_user_attention, which never
flashes a focused window), and the flash is stopped when the window is
focused, the paused thread resumes, or the session ends. A window running
with Focus application on breakpoint still focuses instead of flashing,
and repeated hits while already flashing do not re-request attention.

Closes #1742

Signed-off-by: Inf1mum <[email protected]>
Цей коміт міститься в:
Vadim Lazuk authored and GitHub committed 2026-11-07 01:03:58 +08:00
1 джерело 1f969694a0
коміт fb694aaceb
6 files changed
+191

No files matched your search

+1
Переглянути файл
@@ -424,6 +424,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
window::window_open_deployment,
window::window_cycle,
window::window_toggle_fullscreen,
window::window_flash_taskbar,
window::window_set_titlebar_height,
window_drag::window_start_drag,
window::window_take_launch,
+15
Переглянути файл
@@ -127,6 +127,21 @@ pub fn window_toggle_fullscreen(window: WebviewWindow) -> IdeResult<bool> {
crate::window_groups::toggle_fullscreen(&window)
}
/// Flash (`true`) or stop flashing (`false`) this window's taskbar button, like IDEA when a
/// breakpoint is hit while the window is in the background (macOS bounces the dock icon,
/// Linux sets the urgency hint). A focused window is never flashed: the user is already
/// looking at it, and re-flashing it would steal attention for nothing.
#[tauri::command]
#[specta::specta]
pub fn window_flash_taskbar(window: WebviewWindow, flash: bool) -> IdeResult<()> {
if flash && window.is_focused().unwrap_or(false) {
return Ok(());
}
window
.request_user_attention(flash.then_some(tauri::UserAttentionType::Critical))
.map_err(|e| IdeError::internal(e.to_string()))
}
/// Height of the web title bar in native logical pixels (CSS height × IDE zoom).
#[tauri::command]
#[specta::specta]