diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index 4e84649be5..d49c2c3547 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -176,6 +176,16 @@ void ScreenShotEffect::screenshotWindowUnderCursor(int mask) } } +void ScreenShotEffect::screenshotForWindow(qulonglong winid, int mask) +{ + m_type = (ScreenShotType) mask; + EffectWindow* w = effects->findWindow(winid); + if(w && !w->isMinimized() && !w->isDeleted()) { + m_scheduledScreenshot = w; + m_scheduledScreenshot->addRepaintFull(); + } +} + QString ScreenShotEffect::screenshotFullscreen() { return blitScreenshot(QRect(0, 0, displayWidth(), displayHeight())); diff --git a/effects/screenshot/screenshot.h b/effects/screenshot/screenshot.h index 346501b919..0dcfa5853e 100644 --- a/effects/screenshot/screenshot.h +++ b/effects/screenshot/screenshot.h @@ -45,6 +45,7 @@ public: static bool supported(); static void convertFromGLImage(QImage &img, int w, int h); public Q_SLOTS: + Q_SCRIPTABLE void screenshotForWindow(qulonglong winid, int mask = 0); Q_SCRIPTABLE void screenshotWindowUnderCursor(int mask = 0); /** * Saves a screenshot of all screen into a file and returns the path to the file.