MCPcopy Create free account
hub / github.com/ckaiser/Lightscreen / activeWindow

Method activeWindow

tools/screenshot.cpp:361–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359//
360
361void 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
388const QString Screenshot::extension() const
389{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected