Commit e410d659 authored by David Faure's avatar David Faure

Fix runtime warning about using QPixmap::grabWindow. Not perfect, but not worse.

parent b041bcad
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <QBitmap> #include <QBitmap>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QScrollBar> #include <QScrollBar>
#include <QScreen>
// include files for KDE // include files for KDE
#include <KLocalizedString> #include <KLocalizedString>
...@@ -948,8 +949,9 @@ void KMagZoomView::grabFrame() ...@@ -948,8 +949,9 @@ void KMagZoomView::grabFrame()
QRect selRect = m_selRect.normalized(); QRect selRect = m_selRect.normalized();
// grab screenshot from the screen and put it in the pixmap // grab screenshot from the screen and put it in the pixmap
m_coloredPixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), selRect.x(), selRect.y(), QScreen *screen = qApp->primaryScreen(); // ## How to select the right screen?
selRect.width(), selRect.height()); m_coloredPixmap = screen->grabWindow(QApplication::desktop()->winId(), selRect.x(), selRect.y(),
selRect.width(), selRect.height());
// colorize the grabbed pixmap // colorize the grabbed pixmap
if (m_colormode != 0) if (m_colormode != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment