| 359 | // |
| 360 | |
| 361 | void Screenshot::activeWindow() |
| 362 | { |
| 363 | #ifdef Q_OS_WIN |
| 364 | HWND fWindow = GetForegroundWindow(); |
| 365 | |
| 366 | if (fWindow == NULL) { |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | if (fWindow == GetDesktopWindow()) { |
| 371 | wholeScreen(); |
| 372 | return; |
| 373 | } |
| 374 | |
| 375 | mPixmap = os::grabWindow((WId)GetForegroundWindow()); |
| 376 | #endif |
| 377 | |
| 378 | #if defined(Q_OS_LINUX) |
| 379 | Window focus; |
| 380 | int revert; |
| 381 | |
| 382 | XGetInputFocus(QX11Info::display(), &focus, &revert); |
| 383 | |
| 384 | mPixmap = QPixmap::grabWindow(focus); |
| 385 | #endif |
| 386 | } |
| 387 | |
| 388 | const QString Screenshot::extension() const |
| 389 | { |
nothing calls this directly
no outgoing calls
no test coverage detected