Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/waylandtasksmodel.cpp
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Line(s) | 111 | { | |||
---|---|---|---|---|---|
221 | 221 | | |||
222 | QObject::connect(window, &KWayland::Client::PlasmaWindow::demandsAttentionChanged, q, | 222 | QObject::connect(window, &KWayland::Client::PlasmaWindow::demandsAttentionChanged, q, | ||
223 | [window, this] { this->dataChanged(window, IsDemandingAttention); } | 223 | [window, this] { this->dataChanged(window, IsDemandingAttention); } | ||
224 | ); | 224 | ); | ||
225 | 225 | | |||
226 | QObject::connect(window, &KWayland::Client::PlasmaWindow::skipTaskbarChanged, q, | 226 | QObject::connect(window, &KWayland::Client::PlasmaWindow::skipTaskbarChanged, q, | ||
227 | [window, this] { this->dataChanged(window, SkipTaskbar); } | 227 | [window, this] { this->dataChanged(window, SkipTaskbar); } | ||
228 | ); | 228 | ); | ||
229 | | ||||
230 | QObject::connect(window, &KWayland::Client::PlasmaWindow::pidChanged, q, | ||||
231 | [window, this] { this->dataChanged(window, AppPid); } | ||||
232 | ); | ||||
229 | } | 233 | } | ||
230 | 234 | | |||
231 | AppData WaylandTasksModel::Private::appData(KWayland::Client::PlasmaWindow *window) | 235 | AppData WaylandTasksModel::Private::appData(KWayland::Client::PlasmaWindow *window) | ||
232 | { | 236 | { | ||
233 | const auto &it = appDataCache.constFind(window); | 237 | const auto &it = appDataCache.constFind(window); | ||
234 | 238 | | |||
235 | if (it != appDataCache.constEnd()) { | 239 | if (it != appDataCache.constEnd()) { | ||
236 | return *it; | 240 | return *it; | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 331 | } else if (role == Activities) { | |||
328 | // FIXME Implement. | 332 | // FIXME Implement. | ||
329 | } else if (role == IsDemandingAttention) { | 333 | } else if (role == IsDemandingAttention) { | ||
330 | return window->isDemandingAttention(); | 334 | return window->isDemandingAttention(); | ||
331 | } else if (role == SkipTaskbar) { | 335 | } else if (role == SkipTaskbar) { | ||
332 | return window->skipTaskbar(); | 336 | return window->skipTaskbar(); | ||
333 | } else if (role == SkipPager) { | 337 | } else if (role == SkipPager) { | ||
334 | // FIXME Implement. | 338 | // FIXME Implement. | ||
335 | } else if (role == AppPid) { | 339 | } else if (role == AppPid) { | ||
336 | // FIXME Implement. | 340 | return window->pid(); | ||
graesslin: You are aware that pid is not always correct? Any process started by KWin shares KWin pid. | |||||
Yeah, I'm aware based on how ClientConnection must work. I'll enhance the AppPid role apidox in the abstract model. It's fine with how it's being used currently. hein: Yeah, I'm aware based on how ClientConnection must work. I'll enhance the AppPid role apidox in… | |||||
337 | } | 341 | } | ||
338 | 342 | | |||
339 | return QVariant(); | 343 | return QVariant(); | ||
340 | } | 344 | } | ||
341 | 345 | | |||
342 | int WaylandTasksModel::rowCount(const QModelIndex &parent) const | 346 | int WaylandTasksModel::rowCount(const QModelIndex &parent) const | ||
343 | { | 347 | { | ||
344 | return parent.isValid() ? 0 : d->windows.count(); | 348 | return parent.isValid() ? 0 : d->windows.count(); | ||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |
You are aware that pid is not always correct? Any process started by KWin shares KWin pid. Given that one need to be careful outside of KWin. You should not base any decisions on it and especially not try to close apps based on pid.