mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix wm icon geometry error
Change-Id: I6c93e65369fc88915efa459d9223e427bdf8542f
This commit is contained in:
parent
1f4e07cb8e
commit
119a4ec717
Notes:
Deepin Code Review
2017-06-06 13:33:56 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: Hualet Wang <mr.asianwang@gmail.com> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Tue, 06 Jun 2017 13:33:53 +0800 Reviewed-on: https://cr.deepin.io/23631 Project: dde/dde-dock Branch: refs/heads/master
@ -102,16 +102,12 @@ const QString AppItem::appId() const
|
|||||||
// window behaviors like minimization.
|
// window behaviors like minimization.
|
||||||
void AppItem::updateWindowIconGeometries()
|
void AppItem::updateWindowIconGeometries()
|
||||||
{
|
{
|
||||||
QRect rect(mapToGlobal(QPoint(0, 0)),
|
const QRect r(mapToGlobal(QPoint(0, 0)),
|
||||||
mapToGlobal(QPoint(width(),height())));
|
mapToGlobal(QPoint(width(),height())));
|
||||||
|
auto *xcb_misc = XcbMisc::instance();
|
||||||
|
|
||||||
if (rect != m_lastGlobalGeometry) {
|
for (auto it(m_titles.cbegin()); it != m_titles.cend(); ++it)
|
||||||
QList<quint32> winIds = m_titles.keys();
|
xcb_misc->set_window_icon_geometry(it.key(), r);
|
||||||
for (quint32 winId : winIds) {
|
|
||||||
XcbMisc::instance()->set_window_icon_geometry(winId, rect);
|
|
||||||
}
|
|
||||||
m_lastGlobalGeometry = rect;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppItem::setIconBaseSize(const int size)
|
void AppItem::setIconBaseSize(const int size)
|
||||||
@ -247,9 +243,6 @@ void AppItem::paintEvent(QPaintEvent *e)
|
|||||||
painter.drawPixmap(iconPos, pixmap);
|
painter.drawPixmap(iconPos, pixmap);
|
||||||
else
|
else
|
||||||
painter.drawPixmap(iconPos, ImageFactory::lighterEffect(pixmap));
|
painter.drawPixmap(iconPos, ImageFactory::lighterEffect(pixmap));
|
||||||
|
|
||||||
// Update the window icon geometry when the icon is changed.
|
|
||||||
m_updateIconGeometryTimer->start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppItem::mouseReleaseEvent(QMouseEvent *e)
|
void AppItem::mouseReleaseEvent(QMouseEvent *e)
|
||||||
@ -460,6 +453,7 @@ void AppItem::updateTitle()
|
|||||||
{
|
{
|
||||||
m_titles = m_itemEntry->titles();
|
m_titles = m_itemEntry->titles();
|
||||||
m_appPreviewTips->setWindowInfos(m_titles);
|
m_appPreviewTips->setWindowInfos(m_titles);
|
||||||
|
m_updateIconGeometryTimer->start();
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@ -479,6 +473,8 @@ void AppItem::refershIcon()
|
|||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
m_updateIconGeometryTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppItem::activeChanged()
|
void AppItem::activeChanged()
|
||||||
|
@ -74,7 +74,6 @@ private:
|
|||||||
QPixmap m_activeHorizontalIndicator;
|
QPixmap m_activeHorizontalIndicator;
|
||||||
QPixmap m_activeVerticalIndicator;
|
QPixmap m_activeVerticalIndicator;
|
||||||
|
|
||||||
QRect m_lastGlobalGeometry;
|
|
||||||
QTimer *m_updateIconGeometryTimer;
|
QTimer *m_updateIconGeometryTimer;
|
||||||
|
|
||||||
static int IconBaseSize;
|
static int IconBaseSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user