Bug 512487 - Icons-and-Text task manager loses open windows when second display disconnected
Summary: Icons-and-Text task manager loses open windows when second display disconnected
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: 6.4.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-22 20:01 UTC by Eugene
Modified: 2026-02-16 20:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene 2025-11-22 20:01:18 UTC
SUMMARY
Icons-and-Text task manager loses open windows when second display is disconnected and "Show only tasks: From current screen" is enabled.

STEPS TO REPRODUCE
2 display configuration (secondary display left-of primary) on Wayland with AMDGPU drivers.
1. Configure Icons-and-Text task manager on each screen's panel with "Show only tasks: From current screen" checked.
2. Work for several days in a single KDE session (with suspends but w/o logout/shutdown)
3. Physically disconnect the second (left) screen

OBSERVED RESULT
There are no more tasks for open windows/applications on the Icons-and-Text task manager

EXPECTED RESULT
All opened windows/applications should have an item on the Icons-and-Text task manager

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2

ADDITIONAL INFORMATION
Wayland, 2 displays:
Left: Secondary, HDMI, 1440p
Right: Primary, DisplayPort, 1440p
AMDGPU open-source stock drivers
Ubuntu 25.10 amd64

I have Icons-and-Text task manager on both displays configured to show only tasks "From current screen && From current desktop && From current activity" (I don't use activities)

Sometimes when I disconnect the second display all the tasks disappear from the main screen's  Icons-and-Text task manager (so it becomes empty and display no more tasks). The only way to see them back is to uncheck "From the current screen" checkbox.
This happens not always, but after several days of working. My current uptime is 27 days.
Comment 1 Eugene 2026-02-16 20:11:39 UTC
It looks I've got some understanding why this happening.
I've updated libtaskmanager/taskfilterproxymodel.cpp the routine "bool TaskFilterProxyModel::acceptsRow(int sourceRow) const"
There is a check:
```
// Filter by screen.
  if (d->filterByScreen && d->screenGeometry.isValid()) {
    const QRect &screenGeometry =
        sourceIdx.data(AbstractTasksModel::ScreenGeometry).toRect();

    if (screenGeometry.isValid() && screenGeometry != d->screenGeometry) {
       // I've added this qDebug:
       qDebug() << "task (" << appName << ", " << windowTitle
               << ") doesn't match screen: " << d->screenGeometry
               << "; screenGeometry:" << screenGeometry
               << ", isValid():" << screenGeometry.isValid();
       return false;
    }
  }
```
I have two displays:
2560x1440 left of 5120x1440

So right after reloading/starting plasma everything works fine:
if I disconnect the 2560x1440 display task manager on the 5120x1440 shows all the windows.
However if I go suspend/resume my GNU/Linux box the next time I disconnect 2560x1440 this check fails for all the windows this way:
```
veebr 16 22:00:06 virgil plasmashell[888859]: task ( "Konsole" ,  "mc <..> — Konsole" ) doesn't match screen:  QRect(2560,0 5120x1440) ; screenGeometry: QRect(0,0 5120x1440) , isValid(): true
```
So all the applications have a the correct screenGeometery QRect(0,0 5120x1440), however in the context of TaskFilterProxyModel (d->screenGeometry) the current screen geometry is QRect(2560,0 5120x1440) that is wrong.

I'm not sure whether this is a bug in libtaskmanager or in WM, need more time for investigation, but right now I just have no free time:( 
Would be grateful if someone who knows could help me.
Thank you!
Comment 2 Eugene 2026-02-16 20:20:15 UTC
So when everything works fine (right after plasma reload/restart) TaskFilterProxyModel receives and sets the correct geometry via "void TaskFilterProxyModel::setScreenGeometry(const QRect &geometry)":
QRect(2560,0 5120x1440) when left 2560x1440 is connected
QRect(2560,0 5120x1440) when left 2560x1440 is disconnected
But after computer suspend/resume something goes wrong.