- Add create_debounced_window_state_saver() function in window.rs
- Extract WINDOW_STATE_FLAGS_TO_SAVE and WINDOW_STATE_SAVE_TIMEOUT constants
- Listen to tauri://move and tauri://resize events with 5-second debouncing
- Automatically save window state after positioning changes settle
- Prevent window position loss during system shutdowns/restarts
The debouncing mechanism avoids excessive disk I/O during active window
manipulation while ensuring recent position changes are preserved even
when the application doesn't close normally.
Fixes window position being lost when system restarts before user
manually closes the application.
https://github.com/safing/portmaster/issues/2011
Problem:
System browsers launched from the Portmaster UI (e.g., when a user clicks a link) may be incorrectly detected as Portmaster UI child processes.
Solution:
The Tauri UI app now sets the PORTMASTER_UI_WEBVIEW_PROCESS environment variable for all child WebView processes. Portmaster-core uses this variable to accurately determine if a process is truly related to the Portmaster UI.
Previously, the API endpoint was defined using `localhost`, which could resolve to the IPv6 address `::1`.
This caused issues because the Portmaster core service is listening on `127.0.0.1:817` and only fast-tracking connections to that specific IPv4 address.