Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/x11_platform.cpp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 110 | { | |||
---|---|---|---|---|---|
111 | switch (options->glPlatformInterface()) { | 111 | switch (options->glPlatformInterface()) { | ||
112 | #if HAVE_EPOXY_GLX | 112 | #if HAVE_EPOXY_GLX | ||
113 | case GlxPlatformInterface: | 113 | case GlxPlatformInterface: | ||
114 | if (hasGlx()) { | 114 | if (hasGlx()) { | ||
115 | return new GlxBackend(m_x11Display); | 115 | return new GlxBackend(m_x11Display); | ||
116 | } else { | 116 | } else { | ||
117 | qCWarning(KWIN_X11STANDALONE) << "Glx not available, trying EGL instead."; | 117 | qCWarning(KWIN_X11STANDALONE) << "Glx not available, trying EGL instead."; | ||
118 | // no break, needs fall-through | 118 | // no break, needs fall-through | ||
119 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) | | |||
120 | Q_FALLTHROUGH(); | 119 | Q_FALLTHROUGH(); | ||
121 | #endif | | |||
122 | } | 120 | } | ||
123 | #endif | 121 | #endif | ||
124 | case EglPlatformInterface: | 122 | case EglPlatformInterface: | ||
125 | return new EglOnXBackend(m_x11Display); | 123 | return new EglOnXBackend(m_x11Display); | ||
126 | default: | 124 | default: | ||
127 | // no backend available | 125 | // no backend available | ||
128 | return nullptr; | 126 | return nullptr; | ||
129 | } | 127 | } | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | |||||
231 | { | 229 | { | ||
232 | const QString unsafeKey(QLatin1String("OpenGLIsUnsafe") + (kwinApp()->isX11MultiHead() ? QString::number(kwinApp()->x11ScreenNumber()) : QString())); | 230 | const QString unsafeKey(QLatin1String("OpenGLIsUnsafe") + (kwinApp()->isX11MultiHead() ? QString::number(kwinApp()->x11ScreenNumber()) : QString())); | ||
233 | auto group = KConfigGroup(kwinApp()->config(), "Compositing"); | 231 | auto group = KConfigGroup(kwinApp()->config(), "Compositing"); | ||
234 | switch (safePoint) { | 232 | switch (safePoint) { | ||
235 | case OpenGLSafePoint::PreInit: | 233 | case OpenGLSafePoint::PreInit: | ||
236 | group.writeEntry(unsafeKey, true); | 234 | group.writeEntry(unsafeKey, true); | ||
237 | group.sync(); | 235 | group.sync(); | ||
238 | // Deliberately continue with PreFrame | 236 | // Deliberately continue with PreFrame | ||
239 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) | | |||
240 | Q_FALLTHROUGH(); | 237 | Q_FALLTHROUGH(); | ||
241 | #endif | | |||
242 | case OpenGLSafePoint::PreFrame: | 238 | case OpenGLSafePoint::PreFrame: | ||
243 | if (m_openGLFreezeProtectionThread == nullptr) { | 239 | if (m_openGLFreezeProtectionThread == nullptr) { | ||
244 | Q_ASSERT(m_openGLFreezeProtection == nullptr); | 240 | Q_ASSERT(m_openGLFreezeProtection == nullptr); | ||
245 | m_openGLFreezeProtectionThread = new QThread(this); | 241 | m_openGLFreezeProtectionThread = new QThread(this); | ||
246 | m_openGLFreezeProtectionThread->setObjectName("FreezeDetector"); | 242 | m_openGLFreezeProtectionThread->setObjectName("FreezeDetector"); | ||
247 | m_openGLFreezeProtectionThread->start(); | 243 | m_openGLFreezeProtectionThread->start(); | ||
248 | m_openGLFreezeProtection = new QTimer; | 244 | m_openGLFreezeProtection = new QTimer; | ||
249 | m_openGLFreezeProtection->setInterval(15000); | 245 | m_openGLFreezeProtection->setInterval(15000); | ||
Show All 12 Lines | 257 | } else { | |||
262 | Q_ASSERT(m_openGLFreezeProtection); | 258 | Q_ASSERT(m_openGLFreezeProtection); | ||
263 | QMetaObject::invokeMethod(m_openGLFreezeProtection, "start", Qt::QueuedConnection); | 259 | QMetaObject::invokeMethod(m_openGLFreezeProtection, "start", Qt::QueuedConnection); | ||
264 | } | 260 | } | ||
265 | break; | 261 | break; | ||
266 | case OpenGLSafePoint::PostInit: | 262 | case OpenGLSafePoint::PostInit: | ||
267 | group.writeEntry(unsafeKey, false); | 263 | group.writeEntry(unsafeKey, false); | ||
268 | group.sync(); | 264 | group.sync(); | ||
269 | // Deliberately continue with PostFrame | 265 | // Deliberately continue with PostFrame | ||
270 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) | | |||
271 | Q_FALLTHROUGH(); | 266 | Q_FALLTHROUGH(); | ||
272 | #endif | | |||
273 | case OpenGLSafePoint::PostFrame: | 267 | case OpenGLSafePoint::PostFrame: | ||
274 | QMetaObject::invokeMethod(m_openGLFreezeProtection, "stop", Qt::QueuedConnection); | 268 | QMetaObject::invokeMethod(m_openGLFreezeProtection, "stop", Qt::QueuedConnection); | ||
275 | break; | 269 | break; | ||
276 | case OpenGLSafePoint::PostLastGuardedFrame: | 270 | case OpenGLSafePoint::PostLastGuardedFrame: | ||
277 | m_openGLFreezeProtection->deleteLater(); | 271 | m_openGLFreezeProtection->deleteLater(); | ||
278 | m_openGLFreezeProtection = nullptr; | 272 | m_openGLFreezeProtection = nullptr; | ||
279 | m_openGLFreezeProtectionThread->quit(); | 273 | m_openGLFreezeProtectionThread->quit(); | ||
280 | m_openGLFreezeProtectionThread->wait(); | 274 | m_openGLFreezeProtectionThread->wait(); | ||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |