Skip to content

Commit

Permalink
hack around window pixmap problem
Browse files Browse the repository at this point in the history
  • Loading branch information
rburchell committed Oct 5, 2011
1 parent 7bbb317 commit ae726b8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/windowpixmapprovider.cpp
Expand Up @@ -25,6 +25,23 @@ QPixmap WindowPixmapProvider::requestPixmap(const QString &id, QSize *size, cons
QString windowId = id.section('/', 0, 0);
qDebug() << Q_FUNC_INFO << "Requested pixmap for window " << windowId;

QPixmap winPix;

// temporary code; not at all efficient, but it seems to actually work in a
// lot more cases
if (requestedSize.isValid())
winPix = QPixmap::grabWindow(windowId.toLongLong(), 0, 0,
requestedSize.width(), requestedSize.height());
else
winPix = QPixmap::grabWindow(windowId.toLongLong());

if (size)
*size = winPix.size();

return winPix;
// end temporary code


QHash<QString, QPixmap>::ConstIterator it = mPixmaps.find(windowId);
if (it == mPixmaps.constEnd()) {
qWarning() << Q_FUNC_INFO << "PANIC! No pixmap for " << windowId;
Expand Down

0 comments on commit ae726b8

Please sign in to comment.