Verified Commit ec406590 authored by snooxx's avatar snooxx
Browse files

Unbreak screen grabbing

After 39f712a2, KMag would only show small parts of the screen and its
view was overlayed with black and gray areas and even image recursion.
The cursor position would also not correspond to its actual position.

This is due to changing `QApplication::desktop()->winId()` to the window
id of KMag, which is wrong when the whole screen should be grabbed
instead.

Using `0` for the window id is interpreted as the root window by Qt and
fixes the issue.

Test Plan:

Move cursor to the top left and top right corner of the screen. KMag
should always magnify the correct area without any black bars, and the
cursor position should be correctly indicated too.
parent 59c73003
......@@ -968,7 +968,8 @@ void KMagZoomView::grabFrame()
// grab screenshot from the screen and put it in the pixmap
QScreen *screen = qApp->primaryScreen(); // ## How to select the right screen?
m_coloredPixmap = screen->grabWindow(winId(), selRect.x(), selRect.y(),
m_coloredPixmap = screen->grabWindow(0, // WId == 0 is interpreted as the root window / desktop
selRect.x(), selRect.y(),
selRect.width(), selRect.height());
// colorize the grabbed pixmap
......
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