mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
taskswitcher: add support for task reordering based on opening history
This commit is contained in:
parent
f99e8ff037
commit
de1b92e0c2
4 changed files with 13 additions and 7 deletions
|
|
@ -171,7 +171,7 @@ Item {
|
||||||
groupMode: TaskManager.TasksModel.GroupDisabled
|
groupMode: TaskManager.TasksModel.GroupDisabled
|
||||||
|
|
||||||
screenGeometry: plasmoid.screenGeometry
|
screenGeometry: plasmoid.screenGeometry
|
||||||
sortMode: TaskManager.TasksModel.SortAlpha
|
sortMode: TaskManager.TasksModel.SortLastActivated
|
||||||
|
|
||||||
virtualDesktop: virtualDesktopInfo.currentDesktop
|
virtualDesktop: virtualDesktopInfo.currentDesktop
|
||||||
activity: activityInfo.currentActivity
|
activity: activityInfo.currentActivity
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
visible: false
|
visible: false
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
// state object
|
// state object
|
||||||
property var taskSwitcherState: TaskSwitcherState {
|
property var taskSwitcherState: TaskSwitcherState {
|
||||||
taskSwitcher: root
|
taskSwitcher: root
|
||||||
|
|
@ -82,10 +82,15 @@ Item {
|
||||||
taskSwitcherState.xPosition = 0;
|
taskSwitcherState.xPosition = 0;
|
||||||
taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0;
|
taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0;
|
||||||
taskSwitcherState.currentlyBeingOpened = true;
|
taskSwitcherState.currentlyBeingOpened = true;
|
||||||
|
|
||||||
|
// disable reorder feature and the relative delay
|
||||||
|
taskSwitcher.tasksModel.requestLastActivatedReorderDelay(0);
|
||||||
|
|
||||||
// skip to first active task
|
// skip to first active task
|
||||||
if (taskSwitcherState.wasInActiveTask) {
|
if (taskSwitcherState.wasInActiveTask) {
|
||||||
taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row);
|
taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row);
|
||||||
|
} else {
|
||||||
|
taskSwitcherState.goToTaskIndex(tasksCount - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// show task switcher, hide all running apps
|
// show task switcher, hide all running apps
|
||||||
|
|
|
||||||
|
|
@ -157,12 +157,12 @@ QtObject {
|
||||||
// called after a user finishes an interaction (ex. lets go of the screen)
|
// called after a user finishes an interaction (ex. lets go of the screen)
|
||||||
function updateState() {
|
function updateState() {
|
||||||
cancelAnimations();
|
cancelAnimations();
|
||||||
|
|
||||||
// update vertical state
|
// update vertical state
|
||||||
if (movingUp || root.yPosition >= openedYPosition) {
|
if (movingUp || root.yPosition >= openedYPosition) {
|
||||||
// open task switcher and stay
|
// open task switcher and stay
|
||||||
openAnim.restart();
|
openAnim.restart();
|
||||||
} else {
|
} else {
|
||||||
// close task switcher and return to app
|
// close task switcher and return to app
|
||||||
closeAnim.restart();
|
closeAnim.restart();
|
||||||
}
|
}
|
||||||
|
|
@ -221,6 +221,7 @@ QtObject {
|
||||||
taskSwitcher.instantHide();
|
taskSwitcher.instantHide();
|
||||||
|
|
||||||
if (root.wasInActiveTask) {
|
if (root.wasInActiveTask) {
|
||||||
|
taskSwitcher.tasksModel.requestLastActivatedReorderDelay(5000);
|
||||||
taskSwitcher.setSingleActiveWindow(root.currentTaskIndex);
|
taskSwitcher.setSingleActiveWindow(root.currentTaskIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ TaskManager.PipeWireSourceItem {
|
||||||
nodeId: waylandItem.nodeId
|
nodeId: waylandItem.nodeId
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible && waylandItem.uuid.length === 0) {
|
if (visible) {
|
||||||
if (model.WinIdList) {
|
if (model.WinIdList) {
|
||||||
waylandItem.uuid = model.WinIdList[0];
|
waylandItem.uuid = model.WinIdList[0];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue