From 2272b0c2c09dbb4c2ea204ef2c7b0321a79a91c8 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 12 Dec 2014 00:02:48 +0300 Subject: [PATCH] auto commit --- sources/desktop-panel/desktop-panel.cpp | 25 ++++++++++++++++--------- sources/desktop-panel/desktop-panel.h | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/sources/desktop-panel/desktop-panel.cpp b/sources/desktop-panel/desktop-panel.cpp index 7cd43d7..c0d12cc 100644 --- a/sources/desktop-panel/desktop-panel.cpp +++ b/sources/desktop-panel/desktop-panel.cpp @@ -142,12 +142,12 @@ void DesktopPanel::init() } -WId DesktopPanel::getDesktopId(const int num) +QPixmap DesktopPanel::getDesktopId(const int num) { if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG << ":" << "Number" << num; - WId wid = 0; + QList desktops; QList windows = KWindowSystem::windows(); for (int i=0; iwinId(); - wid = QApplication::desktop()->winId(); + if (desktops.count() == 0) return QPixmap(); - return wid; + QPixmap pixmap = QPixmap::grabWindow(desktops[0]); + QPainter painter(&pixmap); + for (int i=0; isetContent(this, toolTip); diff --git a/sources/desktop-panel/desktop-panel.h b/sources/desktop-panel/desktop-panel.h index 950e4f2..71027d2 100644 --- a/sources/desktop-panel/desktop-panel.h +++ b/sources/desktop-panel/desktop-panel.h @@ -71,7 +71,7 @@ public: DesktopPanel(QObject *parent, const QVariantList &args); ~DesktopPanel(); void init(); - WId getDesktopId(const int num); + QPixmap getDesktopId(const int num); DesktopWindowsInfo getInfoByDesktop(const int num); QString parsePattern(const QString rawLine, const int num);