void WindowThumbnailItem::paint(QPainter *painter) { if (effects) { return; } Client *client = Workspace::self()->findClient(WindowMatchPredicate(m_wId)); if (!client) { return; } QPixmap pixmap = client->icon(boundingRect().size().toSize()); const QSize size(boundingRect().size().toSize() - pixmap.size()); painter->drawPixmap(boundingRect().adjusted(size.width()/2.0, size.height()/2.0, -size.width()/2.0, -size.height()/2.0).toRect(), pixmap); }
void WindowThumbnailItem::setWId(qulonglong wId) { if (m_wId == wId) { return; } m_wId = wId; if (m_wId != 0) { setClient(Workspace::self()->findClient(WindowMatchPredicate(m_wId))); } else if (m_client) { m_client = NULL; emit clientChanged(); } emit wIdChanged(wId); }
Group::Group(Window leader_P) : leader_client(NULL), leader_wid(leader_P), leader_info(NULL), user_time(-1U), refcount(0) { if (leader_P != None) { leader_client = workspace()->findClient(WindowMatchPredicate(leader_P)); unsigned long properties[ 2 ] = { 0, NET::WM2StartupId }; leader_info = new NETWinInfo(display(), leader_P, rootWindow(), properties, 2); } effect_group = new EffectWindowGroupImpl(this); workspace()->addGroup(this); }