Commit 73c142fe authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Extend the screenshot effect API.

Makes it possible to take a screenshot for a given window ID.

REVIEW: 104388
parent 2ba3a5a6
......@@ -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()));
......
......@@ -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.
......
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