summaryrefslogtreecommitdiff
path: root/kde
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-06-24 02:51:53 +0200
committerDennis kasprzyk <onestone@opencompositing.org>2008-06-24 02:51:53 +0200
commit9b3f805077228f97adcd130a0158bd216489d2cd (patch)
tree3aa7581d26511b99cfe014ce2125d3e15f68390e /kde
parent4271289b97d6d2abddadd6c06c19a360c2ed1bd5 (diff)
downloadzcomp-9b3f805077228f97adcd130a0158bd216489d2cd.tar.gz
zcomp-9b3f805077228f97adcd130a0158bd216489d2cd.tar.bz2
Use default icon, if no icon is stored in the window properties.
Diffstat (limited to 'kde')
-rw-r--r--kde/window-decorator-kde4/window.cpp39
-rw-r--r--kde/window-decorator-kde4/window.h3
2 files changed, 33 insertions, 9 deletions
diff --git a/kde/window-decorator-kde4/window.cpp b/kde/window-decorator-kde4/window.cpp
index c24c3c1..cd0731b 100644
--- a/kde/window-decorator-kde4/window.cpp
+++ b/kde/window-decorator-kde4/window.cpp
@@ -117,18 +117,28 @@ KWD::Window::Window (WId parentId,
KWindowSystem::NETWM |
KWindowSystem::WMHints );
- if (mIcon.isNull())
- mIcon = KWindowSystem::icon (mClientId, 16, 16, true,
+ mMiniIcon = KWindowSystem::icon (mClientId, 16, 16, true,
KWindowSystem::NETWM |
KWindowSystem::WMHints );
+ if (mIcon.isNull ())
+ {
+ mIcon = KWindowSystem::icon (mClientId, 32, 32, true,
+ KWindowSystem::ClassHint |
+ KWindowSystem::XApp );
+ mMiniIcon = KWindowSystem::icon (mClientId, 16, 16, true,
+ KWindowSystem::ClassHint |
+ KWindowSystem::XApp );
+ }
+
mOpacity = readPropertyShort (mClientId, Atoms::netWmWindowOpacity,
0xffff);
}
else
{
- mIcon = QIcon ();
- mName = QString ("");
+ mIcon = QPixmap ();
+ mMiniIcon = QPixmap ();
+ mName = QString ("");
}
updateFrame (frame);
@@ -139,7 +149,8 @@ KWD::Window::Window (WId parentId,
}
else
{
- mIcon = QIcon ();
+ mIcon = QPixmap ();
+ mMiniIcon = QPixmap ();
mName = QString ("");
mGeometry = QRect (50, 50, 30, 1);
}
@@ -335,7 +346,9 @@ KWD::Window::isResizable (void) const
QIcon
KWD::Window::icon (void) const
{
- return mIcon;
+ QIcon icon (mIcon);
+ icon.addPixmap (mMiniIcon);
+ return icon;
}
QString
@@ -1828,10 +1841,20 @@ KWD::Window::updateIcons (void)
KWindowSystem::NETWM |
KWindowSystem::WMHints);
- if (mIcon.isNull())
- mIcon = KWindowSystem::icon (mClientId, 16, 16, true,
+ mMiniIcon = KWindowSystem::icon (mClientId, 16, 16, true,
KWindowSystem::NETWM |
KWindowSystem::WMHints);
+
+ if (mIcon.isNull ())
+ {
+ mIcon = KWindowSystem::icon (mClientId, 32, 32, true,
+ KWindowSystem::ClassHint |
+ KWindowSystem::XApp );
+ mMiniIcon = KWindowSystem::icon (mClientId, 16, 16, true,
+ KWindowSystem::ClassHint |
+ KWindowSystem::XApp );
+ }
+
mDecor->iconChange ();
}
diff --git a/kde/window-decorator-kde4/window.h b/kde/window-decorator-kde4/window.h
index 5a77a27..a41aaa5 100644
--- a/kde/window-decorator-kde4/window.h
+++ b/kde/window-decorator-kde4/window.h
@@ -217,7 +217,8 @@ class Window:public QWidget, public KDecorationBridge {
WId mSelectedId;
QRect mGeometry;
QString mName;
- QIcon mIcon;
+ QPixmap mIcon;
+ QPixmap mMiniIcon;
decor_extents_t mBorder;
unsigned short mOpacity;
KDecoration *mDecor;