@@ -43,6 +43,8 @@ export class HeartbeatManager extends Disposable {
4343 totalCount : 0 ,
4444 } ;
4545
46+ private focused = true ;
47+
4648 constructor (
4749 private readonly connectionInfo : SSHConnectionParams ,
4850 private readonly workspaceState : WorkspaceState | undefined ,
@@ -73,7 +75,10 @@ export class HeartbeatManager extends Disposable {
7375 this . _register ( vscode . window . onDidOpenTerminal ( ( ) => this . updateLastActivity ( 'onDidOpenTerminal' ) ) ) ;
7476 this . _register ( vscode . window . onDidCloseTerminal ( ( ) => this . updateLastActivity ( 'onDidCloseTerminal' ) ) ) ;
7577 this . _register ( vscode . window . onDidChangeTerminalState ( ( ) => this . updateLastActivity ( 'onDidChangeTerminalState' ) ) ) ;
76- this . _register ( vscode . window . onDidChangeWindowState ( ( ) => this . updateLastActivity ( 'onDidChangeWindowState' ) ) ) ;
78+ this . _register ( vscode . window . onDidChangeWindowState ( ( e ) => {
79+ this . focused = e . focused ;
80+ this . updateLastActivity ( 'onDidChangeWindowState' ) ;
81+ } ) ) ;
7782 this . _register ( vscode . window . onDidChangeActiveColorTheme ( ( ) => this . updateLastActivity ( 'onDidChangeActiveColorTheme' ) ) ) ;
7883 this . _register ( vscode . authentication . onDidChangeSessions ( ( ) => this . updateLastActivity ( 'onDidChangeSessions' ) ) ) ;
7984 this . _register ( vscode . debug . onDidChangeActiveDebugSession ( ( ) => this . updateLastActivity ( 'onDidChangeActiveDebugSession' ) ) ) ;
@@ -216,6 +221,8 @@ export class HeartbeatManager extends Disposable {
216221 clientKind : 'vscode-desktop' ,
217222 debugWorkspace : String ( ! ! this . connectionInfo . debugWorkspace ) ,
218223 delta : Object . fromEntries ( this . eventCounterMap ) ,
224+ focused : this . focused ,
225+ publicApi : ! ! this . workspaceState
219226 } as IDEHeartbeatTelemetryData ) ;
220227
221228 this . eventCounterMap . clear ( ) ;
0 commit comments