Skip to content

Commit 4c43b1a

Browse files
committed
Add back show window count option
1 parent 19a7284 commit 4c43b1a

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,8 @@ class AppGroup {
11131113
if (this.groupState.willUnmount) return;
11141114

11151115
this.groupState.set({windowCount: this.groupState.metaWindows ? this.groupState.metaWindows.length : 0});
1116-
this.updateWindowsBadge();
1117-
}
1118-
1119-
updateWindowsBadge(){
1120-
if (this.groupState.windowCount > 1) {
1116+
1117+
if (this.groupState.windowCount > 1 && this.state.settings.enableWindowCountBadges) {
11211118
this.windowsBadgeLabel.text = this.groupState.windowCount.toString();
11221119
this.windowsBadge.show();
11231120
} else {

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ class GroupedWindowListApplet extends Applet.Applet {
310310
{key: 'super-num-hotkeys', value: 'SuperNumHotkeys', cb: this.bindAppKeys},
311311
{key: 'title-display', value: 'titleDisplay', cb: this.updateTitleDisplay},
312312
{key: 'launcher-animation-effect', value: 'launcherAnimationEffect', cb: null},
313+
{key: 'enable-window-count-badges', value: 'enableWindowCountBadges', cb: this.onEnableWindowCountBadgeChange},
313314
{key: 'enable-notification-badges', value: 'enableNotificationBadges', cb: this.onEnableNotificationsChange},
314315
{key: 'enable-app-button-dragging', value: 'enableDragging', cb: this.draggableSettingChanged},
315316
{key: 'thumbnail-scroll-behavior', value: 'thumbnailScrollBehavior', cb: null},
@@ -592,6 +593,12 @@ class GroupedWindowListApplet extends Applet.Applet {
592593
});
593594
}
594595

596+
onEnableWindowCountBadgeChange() {
597+
this.workspaces.forEach(
598+
workspace => workspace.calcAllWindowNumbers()
599+
);
600+
}
601+
595602
updateAttentionState(display, window) {
596603
this.workspaces.forEach(
597604
workspace => workspace.updateAttentionState(display, window)
@@ -1069,6 +1076,8 @@ class GroupedWindowListApplet extends Applet.Applet {
10691076
}
10701077

10711078
_onNotificationDestroyed(notification) {
1079+
if (!this.workspaces) return;
1080+
10721081
this.workspaces.forEach(workspace => {
10731082
if (!workspace) return;
10741083
workspace.appGroups.forEach(appGroup => {

files/usr/share/cinnamon/applets/[email protected]/settings-schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"keys": [
5151
"title-display",
5252
"launcher-animation-effect",
53+
"enable-window-count-badges",
5354
"enable-notification-badges",
5455
"enable-app-button-dragging"
5556
]
@@ -184,6 +185,12 @@
184185
"Scale": 3
185186
}
186187
},
188+
"enable-window-count-badges": {
189+
"type": "checkbox",
190+
"default": true,
191+
"description": "Show window count badges",
192+
"tooltip": "Indicate on the panel the number of open windows an application has"
193+
},
187194
"enable-notification-badges": {
188195
"type": "checkbox",
189196
"default": true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class Workspace {
333333

334334
calcAllWindowNumbers() {
335335
this.appGroups.forEach( appGroup => {
336-
appGroup.calcWindowNumber(appGroup.groupState.metaWindows);
336+
appGroup.calcWindowNumber();
337337
});
338338
}
339339

0 commit comments

Comments
 (0)