From a3b49d635576c0bcff1742cfd428e701e5f548eb Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 10 Aug 2014 09:25:06 +1000 Subject: [PATCH] Linux screenshot fix --- sleepyhead/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sleepyhead/mainwindow.cpp b/sleepyhead/mainwindow.cpp index 5c5ab9a2..c9ac945f 100644 --- a/sleepyhead/mainwindow.cpp +++ b/sleepyhead/mainwindow.cpp @@ -1520,15 +1520,15 @@ void MainWindow::DelayedScreenshot() h /= pr; #endif -#ifdef Q_OS_WIN32 +#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX) QRect rec = QApplication::desktop()->screenGeometry(); // grab the whole screen - QPixmap desktop = QPixmap::grabWindow(this->winId(), 0, 0, rec.width(), rec.height()); + QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId()); - QPixmap pixmap = desktop.copy(x() * devicePixelRatio(), y() * devicePixelRatio(), width() * devicePixelRatio(), (height()+20) * devicePixelRatio()); + QPixmap pixmap = desktop.copy(x() * devicePixelRatio(), y() * devicePixelRatio(), (width()+6) * devicePixelRatio(), (height()+22) * devicePixelRatio()); -#else +#elif defined(Q_OS_MAC) QPixmap pixmap = QPixmap::grabWindow(this->winId(), x(), y(), w, h+10); #endif