mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-15 08:44:06 +09:00
Adjust drag and drop to work with ungrouped+launchers
This commit is contained in:
12
taskbar.js
12
taskbar.js
@@ -953,6 +953,7 @@ var taskbar = new Lang.Class({
|
||||
|
||||
let appIcons = this._getAppIcons();
|
||||
let sourceIndex = appIcons.indexOf(source);
|
||||
let usingLaunchers = !this.isGroupApps && this._dtpSettings.get_boolean('group-apps-use-launchers');
|
||||
|
||||
// dragging the icon to its original position
|
||||
if (this._dragInfo[0] === sourceIndex) {
|
||||
@@ -985,11 +986,16 @@ var taskbar = new Lang.Class({
|
||||
}
|
||||
|
||||
for (let i = 0, l = appIcons.length; i < l; ++i) {
|
||||
let windows = appIcons[i].window ? [appIcons[i].window] : getAppWindows(appIcons[i].app);
|
||||
let windows = [];
|
||||
|
||||
if (!usingLaunchers || (!source.isLauncher && !appIcons[i].isLauncher)) {
|
||||
windows = appIcons[i].window ? [appIcons[i].window] : getAppWindows(appIcons[i].app);
|
||||
}
|
||||
|
||||
windows.forEach(w => w._dtpPosition = position++);
|
||||
|
||||
if (appFavorites.isFavorite(appIcons[i].app.get_id())) {
|
||||
if ((usingLaunchers && appIcons[i].isLauncher) ||
|
||||
(!usingLaunchers && appFavorites.isFavorite(appIcons[i].app.get_id()))) {
|
||||
++favoritesCount;
|
||||
}
|
||||
}
|
||||
@@ -1000,7 +1006,7 @@ var taskbar = new Lang.Class({
|
||||
} else {
|
||||
appFavorites.addFavoriteAtPos(sourceAppId, favoriteIndex);
|
||||
}
|
||||
} else if (appIsFavorite) {
|
||||
} else if (appIsFavorite && (!usingLaunchers || source.isLauncher)) {
|
||||
appFavorites.removeFavorite(sourceAppId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user