Changeset View
Changeset View
Standalone View
Standalone View
processui/ProcessModel.cpp
Show First 20 Lines • Show All 521 Lines • ▼ Show 20 Line(s) | 516 | { | |||
---|---|---|---|---|---|
522 | if(!properties) | 522 | if(!properties) | ||
523 | return; //Nothing interesting changed | 523 | return; //Nothing interesting changed | ||
524 | 524 | | |||
525 | WindowInfo *w = mWIdToWindowInfo.value(wid); | 525 | WindowInfo *w = mWIdToWindowInfo.value(wid); | ||
526 | if(!w && !newWindow) | 526 | if(!w && !newWindow) | ||
527 | return; //We do not have a record of this window and this is not a new window | 527 | return; //We do not have a record of this window and this is not a new window | ||
528 | 528 | | |||
529 | if(properties == NET::WMIcon) { | 529 | if(properties == NET::WMIcon) { | ||
530 | if(w) | 530 | if(w) { | ||
531 | w->icon = KWindowSystem::icon(wid, HEADING_X_ICON_SIZE, HEADING_X_ICON_SIZE, true); | 531 | w->icon = KWindowSystem::icon(wid, HEADING_X_ICON_SIZE * qApp->devicePixelRatio(), HEADING_X_ICON_SIZE * qApp->devicePixelRatio(), true); | ||
532 | w->icon.setDevicePixelRatio(qApp->devicePixelRatio()); | ||||
533 | } | ||||
532 | return; | 534 | return; | ||
533 | } | 535 | } | ||
534 | /* Get PID for window */ | 536 | /* Get PID for window */ | ||
535 | NETWinInfo info(QX11Info::connection(), wid, QX11Info::appRootWindow(), NET::Properties(properties) & ~NET::WMIcon, NET::Properties2()); | 537 | NETWinInfo info(QX11Info::connection(), wid, QX11Info::appRootWindow(), NET::Properties(properties) & ~NET::WMIcon, NET::Properties2()); | ||
536 | 538 | | |||
537 | if(!w) { | 539 | if(!w) { | ||
538 | //We know that this must be a newWindow | 540 | //We know that this must be a newWindow | ||
539 | qlonglong pid = info.pid(); | 541 | qlonglong pid = info.pid(); | ||
540 | if(!(properties & NET::WMPid && pid)) | 542 | if(!(properties & NET::WMPid && pid)) | ||
541 | return; //No PID for the window - this happens if the process did not set _NET_WM_PID | 543 | return; //No PID for the window - this happens if the process did not set _NET_WM_PID | ||
542 | 544 | | |||
543 | //If we are to get the PID only, we are only interested in the XRes info for this, | 545 | //If we are to get the PID only, we are only interested in the XRes info for this, | ||
544 | //so don't bother if we already have this info | 546 | //so don't bother if we already have this info | ||
545 | if(properties == NET::WMPid && mPidToWindowInfo.contains(pid)) | 547 | if(properties == NET::WMPid && mPidToWindowInfo.contains(pid)) | ||
546 | return; | 548 | return; | ||
547 | 549 | | |||
548 | w = new WindowInfo(wid, pid); | 550 | w = new WindowInfo(wid, pid); | ||
549 | mPidToWindowInfo.insertMulti(pid, w); | 551 | mPidToWindowInfo.insertMulti(pid, w); | ||
550 | mWIdToWindowInfo.insert(wid, w); | 552 | mWIdToWindowInfo.insert(wid, w); | ||
551 | } | 553 | } | ||
552 | 554 | | |||
553 | if(w && (properties & NET::WMIcon)) | 555 | if(w && (properties & NET::WMIcon)) { | ||
554 | w->icon = KWindowSystem::icon(wid, HEADING_X_ICON_SIZE, HEADING_X_ICON_SIZE, true); | 556 | w->icon = KWindowSystem::icon(wid, HEADING_X_ICON_SIZE * qApp->devicePixelRatio(), HEADING_X_ICON_SIZE * qApp->devicePixelRatio(), true); | ||
557 | w->icon.setDevicePixelRatio(qApp->devicePixelRatio()); | ||||
558 | } | ||||
555 | if(properties & NET::WMVisibleName && info.visibleName()) | 559 | if(properties & NET::WMVisibleName && info.visibleName()) | ||
556 | w->name = QString::fromUtf8(info.visibleName()); | 560 | w->name = QString::fromUtf8(info.visibleName()); | ||
557 | else if(properties & NET::WMName) | 561 | else if(properties & NET::WMName) | ||
558 | w->name = QString::fromUtf8(info.name()); | 562 | w->name = QString::fromUtf8(info.name()); | ||
559 | else if(properties & (NET::WMName | NET::WMVisibleName)) | 563 | else if(properties & (NET::WMName | NET::WMVisibleName)) | ||
560 | w->name.clear(); | 564 | w->name.clear(); | ||
561 | 565 | | |||
562 | KSysGuard::Process *process = mProcesses->getProcess(w->pid); | 566 | KSysGuard::Process *process = mProcesses->getProcess(w->pid); | ||
▲ Show 20 Lines • Show All 991 Lines • Show Last 20 Lines |