Skip to content

Commit 2f27461

Browse files
committed
gwl: track last focused window for case when groupApps is disabled
Signed-off-by: Milan Kotykov <[email protected]>
1 parent eb748d9 commit 2f27461

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

files/usr/share/cinnamon/applets/[email protected]/appGroup.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,11 @@ var AppGroup = class AppGroup {
642642
const {appId, metaWindows, lastFocused} = this.groupState;
643643

644644
if (hasFocus === undefined) {
645-
hasFocus = this.workspaceState.lastFocusedApp === appId;
645+
if (this.state.settings.groupApps) {
646+
hasFocus = this.workspaceState.lastFocusedApp === appId;
647+
} else {
648+
hasFocus = this.groupState.metaWindows.includes(this.workspaceState.lastFocusedWindow);
649+
}
646650
}
647651

648652
// If any of the windows associated with our app have focus,
@@ -977,7 +981,10 @@ var AppGroup = class AppGroup {
977981
this.updateNotificationsBadge();
978982
const hasFocus = getFocusState(metaWindow);
979983
if (hasFocus) {
980-
this.workspaceState.set({lastFocusedApp: this.groupState.appId});
984+
this.workspaceState.set({
985+
lastFocusedApp: this.groupState.appId,
986+
lastFocusedWindow: metaWindow
987+
});
981988
}
982989
this.onFocusChange(hasFocus);
983990
}

0 commit comments

Comments
 (0)