дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
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]>
Цей коміт міститься в:
1 джерело
1f969694a0
коміт
fb694aaceb
6 files changed
+191
No files matched your search
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* IDEA-style taskbar flash while a breakpoint holds this window in the background:
|
||||
* the shell flashes the native window (`window_flash_taskbar`, which never flashes a
|
||||
* focused window), this side decides when to ask — on a breakpoint stop while the
|
||||
* window is unfocused — and stops the flash when the window is focused again or the
|
||||
* paused session resumes or ends.
|
||||
*/
|
||||
import { call, commands, isTauri } from "@/platform/ipc";
|
||||
|
||||
/** Whether this window started a flash that nothing has stopped yet. */
|
||||
let flashing = false;
|
||||
/** The reset listener is attached once per page, on the first flash request. */
|
||||
let listening = false;
|
||||
|
||||
/** Stops the flash this window started (no-op when none is running: no extra IPC). */
|
||||
export function stopTaskbarFlash() {
|
||||
if (!flashing) return;
|
||||
flashing = false;
|
||||
if (!isTauri()) return;
|
||||
void call(commands.windowFlashTaskbar(false)).catch(() => undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks the shell to flash the taskbar for a breakpoint hit in a background window.
|
||||
* While already flashing, further hits do not re-request attention; a window that
|
||||
* is focused right now (or became focused while the request was in flight) never
|
||||
* flashes.
|
||||
*/
|
||||
export function flashTaskbarForBreakpoint() {
|
||||
if (!isTauri()) return;
|
||||
if (!listening) {
|
||||
listening = true;
|
||||
window.addEventListener("focus", stopTaskbarFlash);
|
||||
}
|
||||
if (flashing || document.hasFocus()) return;
|
||||
flashing = true;
|
||||
void call(commands.windowFlashTaskbar(true)).catch(() => {
|
||||
flashing = false;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача