Changeset View
Changeset View
Standalone View
Standalone View
main_x11.cpp
Show First 20 Lines • Show All 293 Lines • ▼ Show 20 Line(s) | 288 | if (crashes >= 4) { | |||
---|---|---|---|---|---|
294 | else | 294 | else | ||
295 | ::exit(1); | 295 | ::exit(1); | ||
296 | if (cmd.length() > 500) { | 296 | if (cmd.length() > 500) { | ||
297 | qCDebug(KWIN_CORE) << "Command is too long, truncating"; | 297 | qCDebug(KWIN_CORE) << "Command is too long, truncating"; | ||
298 | cmd = cmd.left(500); | 298 | cmd = cmd.left(500); | ||
299 | } | 299 | } | ||
300 | qCDebug(KWIN_CORE) << "Starting" << cmd << "and exiting"; | 300 | qCDebug(KWIN_CORE) << "Starting" << cmd << "and exiting"; | ||
301 | char buf[1024]; | 301 | char buf[1024]; | ||
302 | sprintf(buf, "%s &", cmd.toAscii().data()); | 302 | sprintf(buf, "%s &", cmd.toLatin1().data()); | ||
303 | system(buf); | 303 | system(buf); | ||
304 | ::exit(1); | 304 | ::exit(1); | ||
305 | } | 305 | } | ||
306 | if (crashes >= 2) { | 306 | if (crashes >= 2) { | ||
307 | // Disable compositing if we have had too many crashes | 307 | // Disable compositing if we have had too many crashes | ||
308 | qCDebug(KWIN_CORE) << "Too many crashes recently, disabling compositing"; | 308 | qCDebug(KWIN_CORE) << "Too many crashes recently, disabling compositing"; | ||
309 | KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing"); | 309 | KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing"); | ||
310 | compgroup.writeEntry("Enabled", false); | 310 | compgroup.writeEntry("Enabled", false); | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 370 | if (i != KWin::Application::x11ScreenNumber() && fork() == 0) { | |||
379 | // want to fork() anymore | 379 | // want to fork() anymore | ||
380 | break; | 380 | break; | ||
381 | } | 381 | } | ||
382 | } | 382 | } | ||
383 | // In the next statement, display_name shouldn't contain a screen | 383 | // In the next statement, display_name shouldn't contain a screen | ||
384 | // number. If it had it, it was removed at the "pos" check | 384 | // number. If it had it, it was removed at the "pos" check | ||
385 | envir.sprintf("DISPLAY=%s.%d", display_name.data(), KWin::Application::x11ScreenNumber()); | 385 | envir.sprintf("DISPLAY=%s.%d", display_name.data(), KWin::Application::x11ScreenNumber()); | ||
386 | 386 | | |||
387 | if (putenv(strdup(envir.toAscii().constData()))) { | 387 | if (putenv(strdup(envir.toLatin1().constData()))) { | ||
388 | fprintf(stderr, "%s: WARNING: unable to set DISPLAY environment variable\n", argv[0]); | 388 | fprintf(stderr, "%s: WARNING: unable to set DISPLAY environment variable\n", argv[0]); | ||
389 | perror("putenv()"); | 389 | perror("putenv()"); | ||
390 | } | 390 | } | ||
391 | } | 391 | } | ||
392 | 392 | | |||
393 | if (signal(SIGTERM, KWin::sighandler) == SIG_IGN) | 393 | if (signal(SIGTERM, KWin::sighandler) == SIG_IGN) | ||
394 | signal(SIGTERM, SIG_IGN); | 394 | signal(SIGTERM, SIG_IGN); | ||
395 | if (signal(SIGINT, KWin::sighandler) == SIG_IGN) | 395 | if (signal(SIGINT, KWin::sighandler) == SIG_IGN) | ||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |