Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/x11_platform.cpp
Show All 37 Lines | |||||
38 | #include "options.h" | 38 | #include "options.h" | ||
39 | #include "overlaywindow_x11.h" | 39 | #include "overlaywindow_x11.h" | ||
40 | #include "non_composited_outline.h" | 40 | #include "non_composited_outline.h" | ||
41 | #include "workspace.h" | 41 | #include "workspace.h" | ||
42 | #include "x11_decoration_renderer.h" | 42 | #include "x11_decoration_renderer.h" | ||
43 | 43 | | |||
44 | #include <KConfigGroup> | 44 | #include <KConfigGroup> | ||
45 | #include <KLocalizedString> | 45 | #include <KLocalizedString> | ||
46 | #include <KCrash> | ||||
46 | 47 | | |||
47 | #include <QThread> | 48 | #include <QThread> | ||
48 | #include <QOpenGLContext> | 49 | #include <QOpenGLContext> | ||
49 | #include <QX11Info> | 50 | #include <QX11Info> | ||
50 | 51 | | |||
51 | namespace KWin | 52 | namespace KWin | ||
52 | { | 53 | { | ||
53 | 54 | | |||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 231 | if (m_openGLFreezeProtectionThread == nullptr) { | |||
231 | Q_ASSERT(m_openGLFreezeProtection == nullptr); | 232 | Q_ASSERT(m_openGLFreezeProtection == nullptr); | ||
232 | m_openGLFreezeProtectionThread = new QThread(this); | 233 | m_openGLFreezeProtectionThread = new QThread(this); | ||
233 | m_openGLFreezeProtectionThread->setObjectName("FreezeDetector"); | 234 | m_openGLFreezeProtectionThread->setObjectName("FreezeDetector"); | ||
234 | m_openGLFreezeProtectionThread->start(); | 235 | m_openGLFreezeProtectionThread->start(); | ||
235 | m_openGLFreezeProtection = new QTimer; | 236 | m_openGLFreezeProtection = new QTimer; | ||
236 | m_openGLFreezeProtection->setInterval(15000); | 237 | m_openGLFreezeProtection->setInterval(15000); | ||
237 | m_openGLFreezeProtection->setSingleShot(true); | 238 | m_openGLFreezeProtection->setSingleShot(true); | ||
238 | m_openGLFreezeProtection->start(); | 239 | m_openGLFreezeProtection->start(); | ||
240 | const QString configName = kwinApp()->config()->name(); | ||||
239 | m_openGLFreezeProtection->moveToThread(m_openGLFreezeProtectionThread); | 241 | m_openGLFreezeProtection->moveToThread(m_openGLFreezeProtectionThread); | ||
240 | connect(m_openGLFreezeProtection, &QTimer::timeout, m_openGLFreezeProtection, | 242 | connect(m_openGLFreezeProtection, &QTimer::timeout, m_openGLFreezeProtection, | ||
241 | [] { | 243 | [configName] { | ||
242 | const QString unsafeKey(QLatin1String("OpenGLIsUnsafe") + (kwinApp()->isX11MultiHead() ? QString::number(kwinApp()->x11ScreenNumber()) : QString())); | 244 | const QString unsafeKey(QLatin1String("OpenGLIsUnsafe") + (kwinApp()->isX11MultiHead() ? QString::number(kwinApp()->x11ScreenNumber()) : QString())); | ||
243 | auto group = KConfigGroup(kwinApp()->config(), "Compositing"); | 245 | auto group = KConfigGroup(KSharedConfig::openConfig(configName), "Compositing"); | ||
244 | group.writeEntry(unsafeKey, true); | 246 | group.writeEntry(unsafeKey, true); | ||
245 | group.sync(); | 247 | group.sync(); | ||
248 | KCrash::setDrKonqiEnabled(false); | ||||
246 | qFatal("Freeze in OpenGL initialization detected"); | 249 | qFatal("Freeze in OpenGL initialization detected"); | ||
247 | }, Qt::DirectConnection); | 250 | }, Qt::DirectConnection); | ||
248 | } else { | 251 | } else { | ||
249 | Q_ASSERT(m_openGLFreezeProtection); | 252 | Q_ASSERT(m_openGLFreezeProtection); | ||
250 | QMetaObject::invokeMethod(m_openGLFreezeProtection, "start", Qt::QueuedConnection); | 253 | QMetaObject::invokeMethod(m_openGLFreezeProtection, "start", Qt::QueuedConnection); | ||
251 | } | 254 | } | ||
252 | break; | 255 | break; | ||
253 | case OpenGLSafePoint::PostInit: | 256 | case OpenGLSafePoint::PostInit: | ||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |