Changeset View
Changeset View
Standalone View
Standalone View
src/screencast.cpp
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 45 | { | |||
---|---|---|---|---|---|
52 | qCDebug(XdgDesktopPortalKdeScreenCast) << " options: " << options; | 52 | qCDebug(XdgDesktopPortalKdeScreenCast) << " options: " << options; | ||
53 | 53 | | |||
54 | Session *session = Session::createSession(this, Session::ScreenCast, app_id, session_handle.path()); | 54 | Session *session = Session::createSession(this, Session::ScreenCast, app_id, session_handle.path()); | ||
55 | 55 | | |||
56 | if (!session) { | 56 | if (!session) { | ||
57 | return 2; | 57 | return 2; | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | connect(session, &Session::closed, [this] () { | 60 | connect(session, &Session::closed, [] () { | ||
61 | WaylandIntegration::stopStreaming(); | 61 | WaylandIntegration::stopAllStreaming(); | ||
62 | }); | 62 | }); | ||
63 | 63 | | |||
64 | return 0; | 64 | return 0; | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | uint ScreenCastPortal::SelectSources(const QDBusObjectPath &handle, | 67 | uint ScreenCastPortal::SelectSources(const QDBusObjectPath &handle, | ||
68 | const QDBusObjectPath &session_handle, | 68 | const QDBusObjectPath &session_handle, | ||
69 | const QString &app_id, | 69 | const QString &app_id, | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 132 | if (!session) { | |||
134 | return 2; | 134 | return 2; | ||
135 | } | 135 | } | ||
136 | 136 | | |||
137 | if (WaylandIntegration::screens().isEmpty()) { | 137 | if (WaylandIntegration::screens().isEmpty()) { | ||
138 | qCWarning(XdgDesktopPortalKdeScreenCast) << "Failed to show dialog as there is no screen to select"; | 138 | qCWarning(XdgDesktopPortalKdeScreenCast) << "Failed to show dialog as there is no screen to select"; | ||
139 | return 2; | 139 | return 2; | ||
140 | } | 140 | } | ||
141 | 141 | | |||
142 | if (!WaylandIntegration::isEGLInitialized()) { | | |||
143 | qCWarning(XdgDesktopPortalKdeScreenCast) << "EGL is not properly initialized"; | | |||
144 | return 2; | | |||
145 | } | | |||
146 | | ||||
147 | QScopedPointer<ScreenChooserDialog, QScopedPointerDeleteLater> screenDialog(new ScreenChooserDialog(app_id, session->multipleSources())); | 142 | QScopedPointer<ScreenChooserDialog, QScopedPointerDeleteLater> screenDialog(new ScreenChooserDialog(app_id, session->multipleSources())); | ||
148 | Utils::setParentWindow(screenDialog.data(), parent_window); | 143 | Utils::setParentWindow(screenDialog.data(), parent_window); | ||
149 | 144 | | |||
150 | connect(session, &Session::closed, screenDialog.data(), &ScreenChooserDialog::reject); | 145 | connect(session, &Session::closed, screenDialog.data(), &ScreenChooserDialog::reject); | ||
151 | 146 | | |||
152 | if (screenDialog->exec()) { | 147 | if (screenDialog->exec()) { | ||
153 | if (!WaylandIntegration::startStreaming(screenDialog->selectedScreens().first())) { | 148 | if (!WaylandIntegration::startStreaming(screenDialog->selectedScreens().first())) { | ||
154 | return 2; | 149 | return 2; | ||
Show All 16 Lines |