Commit 76050a60 authored by Marco Martin's avatar Marco Martin

minimize instead of showdesktop

keep all windows minimized except the active one
parent b79e4f30
......@@ -78,8 +78,16 @@ NanoShell.FullScreenOverlay {
}
function setSingleActiveWindow(id) {
if (id >= 0) {
window.model.requestActivate(window.model.index(id, 0));
if (id < 0) {
return;
}
for (var i = 0 ; i < tasksModel.count; i++) {
var idx = window.model.index(i, 0)
if (i == id) {
window.model.requestActivate(idx);
} else if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsMinimized)) {
tasksModel.requestToggleMinimized(idx);
}
}
}
......@@ -238,7 +246,9 @@ NanoShell.FullScreenOverlay {
onClicked: {
currentTaskIndex = -1;
window.hide();
plasmoid.nativeInterface.showDesktop = true;
//plasmoid.nativeInterface.showDesktop = true;
root.minimizeAll();
}
}
}
......@@ -54,6 +54,24 @@ PlasmaCore.ColorScope {
}
}
function minimizeAll() {
for (var i = 0 ; i < tasksModel.count; i++) {
var idx = tasksModel.makeModelIndex(i);
if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsMinimized)) {
tasksModel.requestToggleMinimized(idx);
}
}
}
function restoreAll() {
for (var i = 0 ; i < tasksModel.count; i++) {
var idx = tasksModel.makeModelIndex(i);
if (tasksModel.data(idx, TaskManager.AbstractTasksModel.IsMinimized)) {
tasksModel.requestToggleMinimized(idx);
}
}
}
TaskManager.TasksModel {
id: tasksModel
groupMode: TaskManager.TasksModel.GroupDisabled
......@@ -189,7 +207,8 @@ PlasmaCore.ColorScope {
checkable: true
onCheckedChanged: {
taskSwitcher.hide();
plasmoid.nativeInterface.showDesktop = checked;
root.minimizeAll();
//plasmoid.nativeInterface.showDesktop = checked;
}
onPressed: mainMouseArea.managePressed(mouse);
onPositionChanged: mainMouseArea.positionChanged(mouse);
......
Markdown is supported
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