summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2025-01-14 21:35:17 +0200
committerMavridis Philippe <[email protected]>2025-01-14 21:35:17 +0200
commit83c58f47ec3d212a7b5003ac98124433bb810668 (patch)
tree473ca1028719091da47da13b9c32d300b83737e6
parentba0e1b1241ee6ac62cc900249645f47ea52877de (diff)
downloadtdebase-83c58f47ec3d212a7b5003ac98124433bb810668.tar.gz
tdebase-83c58f47ec3d212a7b5003ac98124433bb810668.zip
Kicker: ensure timely update of background pixmap in minipager
Signed-off-by: Mavridis Philippe <[email protected]>
-rw-r--r--kicker/applets/minipager/pagerbutton.cpp13
-rw-r--r--kicker/applets/minipager/pagerbutton.h4
2 files changed, 11 insertions, 6 deletions
diff --git a/kicker/applets/minipager/pagerbutton.cpp b/kicker/applets/minipager/pagerbutton.cpp
index 22f59956d..6bd13ca3e 100644
--- a/kicker/applets/minipager/pagerbutton.cpp
+++ b/kicker/applets/minipager/pagerbutton.cpp
@@ -92,7 +92,7 @@ KMiniPagerButton::KMiniPagerButton(int desk, bool useViewPorts, const TQPoint& v
{
setMouseTracking(true);
}
- loadBgPixmap();
+ TQTimer::singleShot(0, this, TQ_SLOT(loadBgPixmap()));
}
KMiniPagerButton::~KMiniPagerButton()
@@ -183,6 +183,7 @@ void KMiniPagerButton::resizeEvent(TQResizeEvent *ev)
delete m_bgPixmap;
m_bgPixmap = 0;
+ loadBgPixmap();
TQButton::resizeEvent(ev);
}
@@ -208,6 +209,8 @@ void KMiniPagerButton::backgroundChanged()
void KMiniPagerButton::loadBgPixmap()
{
+ TQMutexLocker lock(&m_pixmapLoadLock);
+
bool retval;
if (m_pager->bgType() != PagerSettings::EnumBackgroundType::BgLive)
@@ -372,10 +375,10 @@ void KMiniPagerButton::drawButton(TQPainter *bp)
{
bp->fillRect(0, 0, width(), height(), paletteBackgroundColor());
}
-
+
// desktop background
-
+
if (liveBkgnd)
{
if (m_bgPixmap && !m_bgPixmap->isNull())
@@ -512,7 +515,7 @@ void KMiniPagerButton::drawButton(TQPainter *bp)
{
TQString label = (m_pager->labelType() == PagerSettings::EnumLabelType::LabelNumber) ?
TQString::number(m_desktop) : m_desktopName;
-
+
if (transparent || liveBkgnd)
{
bp->setPen(on ? colorGroup().midlight() : colorGroup().buttonText());
@@ -521,7 +524,7 @@ void KMiniPagerButton::drawButton(TQPainter *bp)
else
bp->drawText(0, 0, w, h, AlignCenter, label);
}
-
+
if (m_inside)
KickerLib::drawBlendedRect(bp, TQRect(1, 1, width() - 2, height() - 2), colorGroup().foreground());
}
diff --git a/kicker/applets/minipager/pagerbutton.h b/kicker/applets/minipager/pagerbutton.h
index 4d889c39e..7213183ad 100644
--- a/kicker/applets/minipager/pagerbutton.h
+++ b/kicker/applets/minipager/pagerbutton.h
@@ -25,6 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define __MINIPAGERBUTTON_H
#include <tqbutton.h>
+#include <tqmutex.h>
#include "taskmanager.h"
#include "kickertip.h"
@@ -79,10 +80,10 @@ private slots:
void slotClicked();
void slotDragSwitch();
+ void loadBgPixmap();
void backgroundLoaded( bool loaded );
private:
- void loadBgPixmap();
TQRect mapGeometryToViewport(const KWin::WindowInfo&) const;
TQPoint mapPointToViewport(const TQPoint&) const;
@@ -103,6 +104,7 @@ private:
static TDESharedPixmap *s_commonSharedPixmap;
static KPixmap *s_commonBgPixmap;
bool m_isCommon;
+ TQMutex m_pixmapLoadLock;
Task::Ptr m_currentWindow;
bool m_inside;