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