Changeset View
Changeset View
Standalone View
Standalone View
main_x11.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | #include <QDialog> | 42 | #include <QDialog> | ||
43 | #include <QDialogButtonBox> | 43 | #include <QDialogButtonBox> | ||
44 | #include <QFile> | 44 | #include <QFile> | ||
45 | #include <QLabel> | 45 | #include <QLabel> | ||
46 | #include <QPushButton> | 46 | #include <QPushButton> | ||
47 | #include <QSurfaceFormat> | 47 | #include <QSurfaceFormat> | ||
48 | #include <QVBoxLayout> | 48 | #include <QVBoxLayout> | ||
49 | #include <QX11Info> | 49 | #include <QX11Info> | ||
50 | #include <QtDBus> | ||||
50 | 51 | | |||
51 | // system | 52 | // system | ||
52 | #ifdef HAVE_UNISTD_H | 53 | #ifdef HAVE_UNISTD_H | ||
53 | #include <unistd.h> | 54 | #include <unistd.h> | ||
54 | #endif // HAVE_UNISTD_H | 55 | #endif // HAVE_UNISTD_H | ||
55 | #include <iostream> | 56 | #include <iostream> | ||
56 | 57 | | |||
57 | Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtCriticalMsg) | 58 | Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtCriticalMsg) | ||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Line(s) | 307 | if (crashes >= 2) { | |||
308 | qCDebug(KWIN_CORE) << "Too many crashes recently, disabling compositing"; | 309 | qCDebug(KWIN_CORE) << "Too many crashes recently, disabling compositing"; | ||
309 | KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing"); | 310 | KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing"); | ||
310 | compgroup.writeEntry("Enabled", false); | 311 | compgroup.writeEntry("Enabled", false); | ||
311 | } | 312 | } | ||
312 | // Reset crashes count if we stay up for more that 15 seconds | 313 | // Reset crashes count if we stay up for more that 15 seconds | ||
313 | QTimer::singleShot(15 * 1000, this, SLOT(resetCrashesCount())); | 314 | QTimer::singleShot(15 * 1000, this, SLOT(resetCrashesCount())); | ||
314 | } | 315 | } | ||
315 | 316 | | |||
317 | void ApplicationX11::notifyKSplash() | ||||
318 | { | ||||
319 | // Tell KSplash that KWin has started | ||||
320 | QDBusMessage ksplashProgressMessage = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"), | ||||
321 | QStringLiteral("/KSplash"), | ||||
322 | QStringLiteral("org.kde.KSplash"), | ||||
323 | QStringLiteral("setStage")); | ||||
324 | ksplashProgressMessage.setArguments(QList<QVariant>() << QStringLiteral("wm")); | ||||
325 | QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); | ||||
326 | } | ||||
327 | | ||||
316 | void ApplicationX11::crashHandler(int signal) | 328 | void ApplicationX11::crashHandler(int signal) | ||
317 | { | 329 | { | ||
318 | crashes++; | 330 | crashes++; | ||
319 | 331 | | |||
320 | fprintf(stderr, "Application::crashHandler() called with signal %d; recent crashes: %d\n", signal, crashes); | 332 | fprintf(stderr, "Application::crashHandler() called with signal %d; recent crashes: %d\n", signal, crashes); | ||
321 | char cmd[1024]; | 333 | char cmd[1024]; | ||
322 | sprintf(cmd, "%s --crashes %d &", | 334 | sprintf(cmd, "%s --crashes %d &", | ||
323 | QFile::encodeName(QCoreApplication::applicationFilePath()).constData(), crashes); | 335 | QFile::encodeName(QCoreApplication::applicationFilePath()).constData(), crashes); | ||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |