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

This commit is contained in:
Fang Tan 2020-09-30 11:34:32 +08:00
parent 5e6c81eea0
commit 03a27a0081
2 changed files with 7 additions and 1 deletions

View file

@ -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();
}
}

View file

@ -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);
/**