Assign overlay numbers to apps instead of windows when ungrouped

This commit is contained in:
Charles Gagnon
2018-10-02 14:15:36 -04:00
parent 21966fbbce
commit b945354788
3 changed files with 22 additions and 22 deletions

View File

@@ -701,7 +701,7 @@ var taskbarAppIcon = new Lang.Class({
this.icon.actor.get_theme_node().get_border_image());
},
activate: function(button) {
activate: function(button, handleAsGrouped) {
if (this.windowPreview)
this.windowPreview.requestCloseMenu();
@@ -746,7 +746,7 @@ var taskbarAppIcon = new Lang.Class({
// We customize the action only when the application is already running
if (appIsRunning && !this.isLauncher) {
if (this.window) {
if (this.window && !handleAsGrouped) {
//ungrouped applications behaviors
switch (buttonAction) {
case 'RAISE': case 'CYCLE': case 'CYCLE-MIN': case 'MINIMIZE':

View File

@@ -146,21 +146,20 @@ var dtpOverview = new Lang.Class({
// Hotkeys
_activateApp: function(appIndex) {
let children = this.taskbar._box.get_children().filter(function(actor) {
return actor.child &&
actor.child._delegate &&
actor.child._delegate.app;
let seenApps = {};
let apps = [];
this.taskbar._getAppIcons().forEach(function(appIcon) {
if (!seenApps[appIcon.app]) {
seenApps[appIcon.app] = 1;
apps.push(appIcon);
}
});
// Apps currently in the taskbar
let apps = children.map(function(actor) {
return actor.child._delegate;
});
// Activate with button = 1, i.e. same as left click
let button = 1;
if (appIndex < apps.length)
apps[appIndex].activate(button);
apps[appIndex].activate(button, true);
},
_optionalHotKeys: function() {

View File

@@ -882,21 +882,22 @@ var taskbar = new Lang.Class({
},
_updateNumberOverlay: function() {
let appIcons = this._getAppIcons();
let counter = 1;
appIcons.forEach(function(icon) {
if (counter < 10){
icon.setNumberOverlay(counter);
let seenApps = {};
let counter = 0;
this._getAppIcons().forEach(function(icon) {
if (!seenApps[icon.app]) {
seenApps[icon.app] = 1;
counter++;
}
else if (counter == 10) {
icon.setNumberOverlay(0);
counter++;
}
else {
if (counter <= 10) {
icon.setNumberOverlay(counter == 10 ? 0 : counter);
} else {
// No overlay after 10
icon.setNumberOverlay(-1);
}
icon.updateNumberOverlay();
});