Skip to content

Commit 29157d4

Browse files
authored
Improve heartbeat activity detection on onDidChangeWindowState event (#106)
* Improve heartbeat activity detection on `onDidChangeWindowState` event * Don't check `active` as it's buggy
1 parent 2f9e676 commit 29157d4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Gitpod",
44
"description": "Gitpod Support",
55
"publisher": "gitpod",
6-
"version": "0.0.168",
6+
"version": "0.0.169",
77
"license": "MIT",
88
"icon": "resources/gitpod.png",
99
"repository": {

src/heartbeat.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ export class HeartbeatManager extends Disposable {
7676
this._register(vscode.window.onDidCloseTerminal(() => this.updateLastActivity('onDidCloseTerminal')));
7777
this._register(vscode.window.onDidChangeTerminalState(() => this.updateLastActivity('onDidChangeTerminalState')));
7878
this._register(vscode.window.onDidChangeWindowState((e) => {
79-
this.focused = e.focused;
80-
this.updateLastActivity('onDidChangeWindowState');
79+
if (e.focused !== this.focused) {
80+
this.focused = e.focused;
81+
this.updateLastActivity('onDidChangeWindowState');
82+
}
8183
}));
8284
this._register(vscode.window.onDidChangeActiveColorTheme(() => this.updateLastActivity('onDidChangeActiveColorTheme')));
8385
this._register(vscode.authentication.onDidChangeSessions(() => this.updateLastActivity('onDidChangeSessions')));

0 commit comments

Comments
 (0)