1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

Adjust Latte Dock to libtaskmanager API changes for Wayland

Summary:
Changes in libtaskmanager in Plasma 5.15 currently break several Latte Dock features. This patch ensures that Latte Dock will continue to work when Plasma 5.15 is released.

BUG: 403358

Reviewers: mvourlakos

Reviewed By: mvourlakos

Subscribers: plasma-devel

Tags: #latte_dock, #plasma

Differential Revision: https://phabricator.kde.org/D18375
This commit is contained in:
Steffen Coenen 2019-01-19 10:05:02 +02:00 committed by Michail Vourlakos
parent a066ec007b
commit f6ce06f6ae
4 changed files with 10 additions and 8 deletions

View File

@ -147,7 +147,7 @@ PlasmaComponents.ContextMenu {
// Add Media Player control actions
var sourceName = mpris2Source.sourceNameForLauncherUrl(launcherUrl, get(atm.AppPid));
if (sourceName && !(get(atm.LegacyWinIdList) != undefined && get(atm.LegacyWinIdList).length > 1)) {
if (sourceName && !(get( root.plasma515 ? atm.WinIdList : atm.LegacyWinIdList ) != undefined && get( root.plasma515 ? atm.WinIdList : atm.LegacyWinIdList ).length > 1)) {
var playerData = mpris2Source.data[sourceName]
if (playerData.CanControl) {

View File

@ -59,6 +59,8 @@ Item {
//it is used to check both the applet and the containment for direct render
property bool globalDirectRender: latteView ? latteView.globalDirectRender : icList.directRender
property bool plasma515: Latte.WindowSystem.plasmaDesktopVersion >= Latte.WindowSystem.makeVersion(5,14,90)
property bool editMode: latteView ? latteView.editMode : plasmoid.userConfiguring
property bool disableRestoreZoom: false //blocks restore animation in rightClick
property bool disableAllWindowsFunctionality: root.showWindowsOnlyFromLaunchers && root.activeIndicator === Latte.Types.NoneIndicator

View File

@ -762,7 +762,7 @@ MouseArea{
////disable hover effect///
if (isWindow && root.highlightWindows && !containsMouse) {
root.windowsHovered(model.LegacyWinIdList, false);
root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , false);
}
}
@ -969,7 +969,7 @@ MouseArea{
else{
if (model.IsGroupParent) {
if (Latte.WindowSystem.compositingActive && backend.canPresentWindows()) {
root.presentWindows(model.LegacyWinIdList);
root.presentWindows(root.plasma515 ? model.WinIdList: model.LegacyWinIdList );
} else {
if ((windowsPreviewDlg.visualParent === previewsVisualParent)&&(windowsPreviewDlg.visible)) {
windowsPreviewDlg.hide(3);
@ -1024,7 +1024,7 @@ MouseArea{
}
toolTipDelegate.windows = Qt.binding(function() {
return model.LegacyWinIdList;
return root.plasma515 ? model.WinIdList : model.LegacyWinIdList ;
});
toolTipDelegate.isGroup = Qt.binding(function() {
return model.IsGroupParent == true;
@ -1427,7 +1427,7 @@ MouseArea{
mainItemContainer.preparePreviewWindow(false);
windowsPreviewDlg.show(mainItemContainer);
} else if (mainItemContainer.isWindow && root.highlightWindows) {
root.windowsHovered(model.LegacyWinIdList, mainItemContainer.containsMouse);
root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , mainItemContainer.containsMouse);
}
}

View File

@ -64,7 +64,7 @@ Item{
onIsMinimizedChanged: windowsContainer.updateStates();
onIsActiveChanged: {
if (isActive) {
windowsContainer.lastActiveWinInGroup = (LegacyWinIdList!==undefined ? LegacyWinIdList[0] : 0);
windowsContainer.lastActiveWinInGroup = root.plasma515 ? (WinIdList!==undefined ? WinIdList[0] : 0) : (LegacyWinIdList!==undefined ? LegacyWinIdList[0] : 0);
}
windowsContainer.updateStates();
}
@ -184,7 +184,7 @@ Item{
if (nextAvailableWindow === -1 && lastActiveWinInGroup !==-1){
for(var i=0; i<childs.count; ++i){
var kid = childs.get(i);
var kidId = kid.model.LegacyWinIdList ? kid.model.LegacyWinIdList[0] : 0;
var kidId = root.plasma515 ? (kid.model.WinIdList ? kid.model.WinIdList[0] : 0) : (kid.model.LegacyWinIdList ? kid.model.LegacyWinIdList[0] : 0);
if (kidId === lastActiveWinInGroup) {
nextAvailableWindow = i;
@ -229,7 +229,7 @@ Item{
if (prevAvailableWindow === -2 && lastActiveWinInGroup !==-1){
for(var i=childs.count-1; i>=0; --i){
var kid = childs.get(i);
if (kid.model.LegacyWinIdList[0] === lastActiveWinInGroup) {
if ( (root.plasma515 ? kid.model.WinIdList[0] : kid.model.LegacyWinIdList[0]) === lastActiveWinInGroup) {
prevAvailableWindow = i;
break;
}