Fix QScreen::grabWindow() on Windows

Finish up 94ac17c2cc

Task-number: QTBUG-26963

Change-Id: I13f52f0a6cf460d525b53338738aecd4b3cf313c
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
aavit 2012-08-28 15:57:47 +02:00 committed by Qt by Nokia
parent 2b69431d3c
commit dc5359a312

View File

@ -183,12 +183,10 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat =
QPixmap QWindowsScreen::grabWindow(WId window, int x, int y, int width, int height) const
{
// TODO: handle window==0, i.e. grab whole screen
if (QWindowsContext::verboseIntegration)
qDebug() << __FUNCTION__ << window << x << y << width << height;
RECT r;
HWND hwnd = (HWND)window;
HWND hwnd = window ? (HWND)window : GetDesktopWindow();
GetClientRect(hwnd, &r);
if (width < 0) width = r.right - r.left;