mirror of
https://invent.kde.org/plasma/plasma-desktop.git
synced 2026-11-03 14:49:44 -09:00
applets/showdesktop: manually restore focus for minimized windows
Restoring the windows only un-minimized them, so the window that had focus came back without it and typing went to the desktop. Remember the active window when minimizing and activate it again after restoring. BUG: 450137
This commit is contained in:
parent
8cf95a7eaf
commit
c2312d5863
1 changed files with 7 additions and 0 deletions
|
|
@ -67,8 +67,11 @@ Controller {
|
|||
*/
|
||||
property var minimizedClients: ({})
|
||||
|
||||
property var activeClients: ({})
|
||||
|
||||
function activate() {
|
||||
const clients = [];
|
||||
activeClients[activityDesktopId] = tasksModel.activeTask.valid ? tasksModel.makePersistentModelIndex(tasksModel.activeTask.row) : null;
|
||||
for (let i = tasksModel.count - 1; i >= 0; i--) {
|
||||
const idx = tasksModel.makeModelIndex(i);
|
||||
const activities = tasksModel.data(idx, TaskManager.AbstractTasksModel.Activities);
|
||||
|
|
@ -104,6 +107,10 @@ Controller {
|
|||
tasksModel.requestToggleMinimized(idx);
|
||||
}
|
||||
minimizedClients[activityDesktopId] = [];
|
||||
const activeIdx = activeClients[activityDesktopId];
|
||||
if (activeIdx && activeIdx.valid) {
|
||||
tasksModel.requestActivate(activeIdx);
|
||||
}
|
||||
}
|
||||
|
||||
// override
|
||||
|
|
|
|||
Loading…
Reference in a new issue