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
pull/4/head
Steffen Coenen 6 years ago committed by Michail Vourlakos
parent a066ec007b
commit f6ce06f6ae

@ -147,7 +147,7 @@ PlasmaComponents.ContextMenu {
// Add Media Player control actions // Add Media Player control actions
var sourceName = mpris2Source.sourceNameForLauncherUrl(launcherUrl, get(atm.AppPid)); 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] var playerData = mpris2Source.data[sourceName]
if (playerData.CanControl) { if (playerData.CanControl) {

@ -59,6 +59,8 @@ Item {
//it is used to check both the applet and the containment for direct render //it is used to check both the applet and the containment for direct render
property bool globalDirectRender: latteView ? latteView.globalDirectRender : icList.directRender 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 editMode: latteView ? latteView.editMode : plasmoid.userConfiguring
property bool disableRestoreZoom: false //blocks restore animation in rightClick property bool disableRestoreZoom: false //blocks restore animation in rightClick
property bool disableAllWindowsFunctionality: root.showWindowsOnlyFromLaunchers && root.activeIndicator === Latte.Types.NoneIndicator property bool disableAllWindowsFunctionality: root.showWindowsOnlyFromLaunchers && root.activeIndicator === Latte.Types.NoneIndicator

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

@ -64,7 +64,7 @@ Item{
onIsMinimizedChanged: windowsContainer.updateStates(); onIsMinimizedChanged: windowsContainer.updateStates();
onIsActiveChanged: { onIsActiveChanged: {
if (isActive) { 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(); windowsContainer.updateStates();
} }
@ -184,7 +184,7 @@ Item{
if (nextAvailableWindow === -1 && lastActiveWinInGroup !==-1){ if (nextAvailableWindow === -1 && lastActiveWinInGroup !==-1){
for(var i=0; i<childs.count; ++i){ for(var i=0; i<childs.count; ++i){
var kid = childs.get(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) { if (kidId === lastActiveWinInGroup) {
nextAvailableWindow = i; nextAvailableWindow = i;
@ -229,7 +229,7 @@ Item{
if (prevAvailableWindow === -2 && lastActiveWinInGroup !==-1){ if (prevAvailableWindow === -2 && lastActiveWinInGroup !==-1){
for(var i=childs.count-1; i>=0; --i){ for(var i=childs.count-1; i>=0; --i){
var kid = childs.get(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; prevAvailableWindow = i;
break; break;
} }

Loading…
Cancel
Save