ScreenshotEffect: don't expect authorization for interactive screenshots

This commit is contained in:
Méven Car 2020-10-22 11:58:36 +02:00
parent fee696ec88
commit fe41af9e50

View file

@ -548,9 +548,14 @@ bool ScreenShotEffect::checkCall() const
QString ScreenShotEffect::interactive(int mask)
{
if (!checkCall()) {
if (!calledFromDBus()) {
return QString();
}
if (isTakingScreenshot()) {
sendErrorReply(s_errorAlreadyTaking, s_errorAlreadyTakingMsg);
return QString();
}
m_type = (ScreenShotType) mask;
m_windowMode = WindowMode::File;
m_replyMessage = message();
@ -574,9 +579,14 @@ QString ScreenShotEffect::interactive(int mask)
void ScreenShotEffect::interactive(QDBusUnixFileDescriptor fd, int mask)
{
if (!checkCall()) {
if (!calledFromDBus()) {
return;
}
if (isTakingScreenshot()) {
sendErrorReply(s_errorAlreadyTaking, s_errorAlreadyTakingMsg);
return;
}
m_fd = dup(fd.fileDescriptor());
if (m_fd == -1) {
sendErrorReply(s_errorFd, s_errorFdMsg);