summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-03 02:51:37 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-05 05:09:56 +0200
commit1f8bdc6151e34f22dbcf4c863a67636451f48dfb (patch)
treea85c2d2e7601050ba5d1aeaf3e19d7c7e9ba8fd8
parentefcc206a33efd167cabec2610e906e923cff66eb (diff)
downloadtdebase-1f8bdc6151e34f22dbcf4c863a67636451f48dfb.tar.gz
tdebase-1f8bdc6151e34f22dbcf4c863a67636451f48dfb.zip
Hack around ARGB task tray icon background display glitch
(cherry picked from commit 667839ee6560a10aca54885dbf8951b77bdc21b2)
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.cpp23
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.h3
2 files changed, 24 insertions, 2 deletions
diff --git a/kicker/applets/systemtray/systemtrayapplet.cpp b/kicker/applets/systemtray/systemtrayapplet.cpp
index 02b558520..1a96a9372 100644
--- a/kicker/applets/systemtray/systemtrayapplet.cpp
+++ b/kicker/applets/systemtray/systemtrayapplet.cpp
@@ -1130,13 +1130,20 @@ void SystemTrayApplet::setBackground()
TrayEmbed::TrayEmbed( bool kdeTray, TQWidget* parent )
- : QXEmbed( parent ), kde_tray( kdeTray )
+ : QXEmbed( parent ), kde_tray( kdeTray ), m_ensureBackgroundSetTimerCount(0)
{
+ m_ensureBackgroundSetTimer = new TQTimer();
+ connect(m_ensureBackgroundSetTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(ensureBackgroundSet()));
hide();
m_scaledWidget = new TQWidget(parent);
m_scaledWidget->hide();
}
+TrayEmbed::~TrayEmbed()
+{
+ delete m_ensureBackgroundSetTimer;
+}
+
void TrayEmbed::getIconSize(int defaultIconSize)
{
TQSize minSize = minimumSizeHint();
@@ -1170,6 +1177,7 @@ void TrayEmbed::setBackground()
if (!isHidden())
{
XClearArea(x11Display(), embeddedWinId(), 0, 0, 0, 0, True);
+ m_ensureBackgroundSetTimerCount = 0;
ensureBackgroundSet();
}
}
@@ -1182,7 +1190,7 @@ void TrayEmbed::ensureBackgroundSet()
// This is a nasty little hack to make sure that tray icons / applications which do not match our QXEmbed native depth are still displayed properly,
// i.e without irritating white/grey borders where the tray icon's transparency is supposed to be...
// Essentially it converts a 24 bit Xlib Pixmap to a 32 bit Xlib Pixmap
-
+
TQPixmap bg(width(), height());
// Get the RGB background image
@@ -1212,5 +1220,16 @@ void TrayEmbed::ensureBackgroundSet()
XSetWindowBackgroundPixmap(x11Display(), embeddedWinId(), argbpixmap);
XFreePixmap(x11Display(), argbpixmap);
XFreeGC(x11Display(), gc);
+
+ // Repaint
+ XClearArea(x11Display(), embeddedWinId(), 0, 0, 0, 0, True);
+
+ // HACK
+ // Clear background artifacts in first available timeslot after initial icon display
+ if (m_ensureBackgroundSetTimerCount < 1) {
+ m_ensureBackgroundSetTimerCount++;
+ m_ensureBackgroundSetTimer->stop();
+ m_ensureBackgroundSetTimer->start(0, TRUE);
+ }
}
}
diff --git a/kicker/applets/systemtray/systemtrayapplet.h b/kicker/applets/systemtray/systemtrayapplet.h
index 868941c13..84ee06ecb 100644
--- a/kicker/applets/systemtray/systemtrayapplet.h
+++ b/kicker/applets/systemtray/systemtrayapplet.h
@@ -128,12 +128,15 @@ class TrayEmbed : public QXEmbed
Q_OBJECT
public:
TrayEmbed( bool kdeTray, TQWidget* parent = NULL );
+ ~TrayEmbed();
bool kdeTray() const { return kde_tray; }
void setBackground();
void getIconSize(int defaultIconSize);
private:
bool kde_tray;
TQWidget *m_scaledWidget;
+ TQTimer* m_ensureBackgroundSetTimer;
+ int m_ensureBackgroundSetTimerCount;
private slots:
void ensureBackgroundSet();
};