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);