Commit 03a27a00 authored by Fang Tan's avatar Fang Tan

The client may have closed itself here,will cause kwin to crash

parent 5e6c81ee
......@@ -491,6 +491,11 @@ void ScreenShotEffect::screenshotWindowUnderCursor(int mask)
return;
}
m_type = (ScreenShotType)mask;
scheduleScreenshotWindowUnderCursor();
}
void ScreenShotEffect::scheduleScreenshotWindowUnderCursor()
{
const QPoint cursor = effects->cursorPos();
EffectWindowList order = effects->stackingOrder();
EffectWindowList::const_iterator it = order.constEnd(), first = order.constBegin();
......@@ -863,7 +868,7 @@ void ScreenShotEffect::windowClosed( EffectWindow* w )
{
if (w == m_scheduledScreenshot) {
m_scheduledScreenshot = nullptr;
screenshotWindowUnderCursor(m_type);
scheduleScreenshotWindowUnderCursor();
}
}
......
......@@ -49,6 +49,7 @@ public:
static bool supported();
static void convertFromGLImage(QImage &img, int w, int h);
void scheduleScreenshotWindowUnderCursor();
public Q_SLOTS:
Q_SCRIPTABLE void screenshotForWindow(qulonglong winid, int mask = 0);
/**
......
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