Commit 3c3b5c6d authored by Michail Vourlakos's avatar Michail Vourlakos
Browse files

tasks:support plasma 5.25 window view effect

--support window view effect from plasma 5.25 when
the user tries to activate a grouped task

BUG:454296
parent 771f059e
......@@ -50,6 +50,7 @@ Item {
property bool plasma518: LatteCore.Environment.plasmaDesktopVersion >= LatteCore.Environment.makeVersion(5,18,0)
property bool plasma520: LatteCore.Environment.plasmaDesktopVersion >= LatteCore.Environment.makeVersion(5,20,0)
property bool plasmaGreaterThan522: LatteCore.Environment.plasmaDesktopVersion >= LatteCore.Environment.makeVersion(5,21,75)
property bool plasmaAtLeast525: LatteCore.Environment.plasmaDesktopVersion >= LatteCore.Environment.makeVersion(5,24,75)
property bool disableRestoreZoom: false //blocks restore animation in rightClick
property bool disableAllWindowsFunctionality: plasmoid.configuration.hideAllTasks
......@@ -205,6 +206,7 @@ Item {
signal draggingFinished();
signal hiddenTasksUpdated();
signal presentWindows(variant winIds);
signal activateWindowView(variant winIds);
signal requestLayout;
signal signalPreviewsShown();
//signal signalDraggingState(bool value);
......@@ -1296,14 +1298,24 @@ Item {
}
Component.onCompleted: {
root.presentWindows.connect(backend.presentWindows);
if (root.plasmaAtLeast525) {
root.activateWindowView.connect(backend.activateWindowView);
} else {
root.presentWindows.connect(backend.presentWindows);
}
root.windowsHovered.connect(backend.windowsHovered);
dragHelper.dropped.connect(resetDragSource);
updateListViewParent();
}
Component.onDestruction: {
root.presentWindows.disconnect(backend.presentWindows);
if (root.plasmaAtLeast525) {
root.activateWindowView.disconnect(backend.activateWindowView);
} else {
root.presentWindows.disconnect(backend.presentWindows);
}
root.windowsHovered.disconnect(backend.windowsHovered);
dragHelper.dropped.disconnect(resetDragSource);
}
......
......@@ -428,9 +428,18 @@ AbilityItem.BasicItem {
activateLauncher();
} else{
if (model.IsGroupParent) {
var canPresentWindowsIsSupported = LatteCore.WindowSystem.compositingActive && (root.plasmaGreaterThan522 ? backend.canPresentWindows : backend.canPresentWindows());
if (canPresentWindowsIsSupported) {
root.presentWindows(root.plasma515 ? model.WinIdList: model.LegacyWinIdList );
if (root.plasmaAtLeast525) {
//! At least Plasma 5.25 case
var isWindowViewAvailable = LatteCore.WindowSystem.compositingActive && backend.windowViewAvailable;
if (isWindowViewAvailable) {
root.activateWindowView(model.WinIdList);
}
} else {
//! Plasma 5.24 case
var isPresentWindowsAvailable = LatteCore.WindowSystem.compositingActive && backend.canPresentWindows;
if (isPresentWindowsAvailable) {
root.presentWindows(model.WinIdList);
}
}
} else {
if (windowsPreviewDlg.visible) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment