diff --git a/src/remotedesktop.cpp b/src/remotedesktop.cpp index 99ce57f..af64eff 100644 --- a/src/remotedesktop.cpp +++ b/src/remotedesktop.cpp @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include RemoteDesktopPortal::RemoteDesktopPortal(QObject *parent) @@ -152,14 +154,19 @@ uint RemoteDesktopPortal::Start(const QDBusObjectPath &handle, notification->setIconName(QStringLiteral("krfb")); notification->sendEvent(); } else { - QScopedPointer remoteDesktopDialog( - new RemoteDesktopDialog(app_id, session->deviceTypes(), session->screenSharingEnabled())); - Utils::setParentWindow(remoteDesktopDialog->windowHandle(), parent_window); - Request::makeClosableDialogRequest(handle, remoteDesktopDialog.get()); - connect(session, &Session::closed, remoteDesktopDialog.data(), &RemoteDesktopDialog::reject); - - if (!remoteDesktopDialog->exec()) { - return 1; + auto cfg = KSharedConfig::openConfig(QStringLiteral("plasmaremotedesktoprc")); + const auto unattendedAccess = cfg->group("Sharing").readEntry("Unattended", false); + if (!unattendedAccess) + { + QScopedPointer remoteDesktopDialog( + new RemoteDesktopDialog(app_id, session->deviceTypes(), session->screenSharingEnabled())); + Utils::setParentWindow(remoteDesktopDialog->windowHandle(), parent_window); + Request::makeClosableDialogRequest(handle, remoteDesktopDialog.get()); + connect(session, &Session::closed, remoteDesktopDialog.data(), &RemoteDesktopDialog::reject); + + if (!remoteDesktopDialog->exec()) { + return 1; + } } }