fix(appwindow): handle slow reports and guide Guest Tools upgrades

This commit is contained in:
YXC0915 committed 2026-12-05 03:42:41 +08:00
1 parent 2658949f05
commit 3020137a9e
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -108,6 +108,9 @@ func (a *App) prepareAppWindow(ctx context.Context, bridge *guesttools.Server, s
return nil, ctx.Err()
}
if errors.Is(err, appwindow.ErrNoWindow) {
if status.AgentVersion < guesttools.StableWindowReporterAgentVersion {
return nil, coded("E_APP_WINDOW_GUEST_TOOLS_UPDATE", "err.app_window_guest_tools_update", nil)
}
return nil, coded("E_APP_WINDOW_NO_WINDOW", "err.app_window_no_window", nil)
}
return nil, coded("E_APP_WINDOW_CAPTURE", "err.app_window_capture", err)
+1 -1
View File
@@ -233,7 +233,7 @@ func (s *session) capture(ctx context.Context) (ViewerFrame, error) {
func (s *session) confirmFrame(ctx context.Context, before guesttools.ActiveWindow, capturedAt time.Time) error {
// Reading the same cached report twice cannot detect a window moving between polls.
timeout := time.NewTimer(650 * time.Millisecond)
timeout := time.NewTimer(windowMaxAge)
defer timeout.Stop()
tick := time.NewTicker(15 * time.Millisecond)
defer tick.Stop()