@@ -43,6 +43,8 @@ export class HeartbeatManager extends Disposable {
43
43
totalCount : 0 ,
44
44
} ;
45
45
46
+ private focused = true ;
47
+
46
48
constructor (
47
49
private readonly connectionInfo : SSHConnectionParams ,
48
50
private readonly workspaceState : WorkspaceState | undefined ,
@@ -73,7 +75,10 @@ export class HeartbeatManager extends Disposable {
73
75
this . _register ( vscode . window . onDidOpenTerminal ( ( ) => this . updateLastActivity ( 'onDidOpenTerminal' ) ) ) ;
74
76
this . _register ( vscode . window . onDidCloseTerminal ( ( ) => this . updateLastActivity ( 'onDidCloseTerminal' ) ) ) ;
75
77
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
+ } ) ) ;
77
82
this . _register ( vscode . window . onDidChangeActiveColorTheme ( ( ) => this . updateLastActivity ( 'onDidChangeActiveColorTheme' ) ) ) ;
78
83
this . _register ( vscode . authentication . onDidChangeSessions ( ( ) => this . updateLastActivity ( 'onDidChangeSessions' ) ) ) ;
79
84
this . _register ( vscode . debug . onDidChangeActiveDebugSession ( ( ) => this . updateLastActivity ( 'onDidChangeActiveDebugSession' ) ) ) ;
@@ -216,6 +221,8 @@ export class HeartbeatManager extends Disposable {
216
221
clientKind : 'vscode-desktop' ,
217
222
debugWorkspace : String ( ! ! this . connectionInfo . debugWorkspace ) ,
218
223
delta : Object . fromEntries ( this . eventCounterMap ) ,
224
+ focused : this . focused ,
225
+ publicApi : ! ! this . workspaceState
219
226
} as IDEHeartbeatTelemetryData ) ;
220
227
221
228
this . eventCounterMap . clear ( ) ;
0 commit comments