Commit 1b07c380 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Move warning

When we open a messagebox inside void initializeGL(), it starts
an eventloop before the canvas is created, so everything crashes.
parent be28b1b6
......@@ -63,6 +63,7 @@ void KisOpenGL::initialize()
}
format.setSwapInterval(0); // Disable vertical refresh syncing
QSurfaceFormat::setDefaultFormat(format);
#endif
}
......@@ -77,6 +78,27 @@ int KisOpenGL::initializeContext(QOpenGLContext* s) {
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
/**
* Warn about Intel's broken video drivers
*/
#if defined HAVE_OPENGL && defined Q_OS_WIN
#ifndef GL_RENDERER
# define GL_RENDERER 0x1F01
#endif
QString renderer = QString((const char*)f.glGetString(GL_RENDERER));
if (cfg.useOpenGL() && renderer.startsWith("Intel") && !cfg.readEntry("WarnedAboutIntel", false)) {
QMessageBox::information(0,
i18nc("@title:window", "Krita: Warning"),
i18n("You have an Intel(R) HD Graphics video adapter.\n"
"If you experience problems like a black or blank screen,"
"please update your display driver to the latest version.\n\n"
"You can also disable OpenGL rendering in Krita's Settings.\n"));
cfg.writeEntry("WarnedAboutIntel", true);
}
#endif
QFile log(QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/krita-opengl.txt");
dbgUI << "Writing OpenGL log to" << log.fileName();
log.open(QFile::WriteOnly);
......
......@@ -249,28 +249,6 @@ void KisOpenGLCanvas2::initializeGL()
Sync::init(context());
/**
* Warn about Intel's broken video drivers
*/
#if defined HAVE_OPENGL && defined Q_OS_WIN
#ifndef GL_RENDERER
# define GL_RENDERER 0x1F01
#endif
QString renderer = QString((const char*)glGetString(GL_RENDERER));
if (cfg.useOpenGL() && renderer.startsWith("Intel") && !cfg.readEntry("WarnedAboutIntel", false)) {
QMessageBox::information(0,
i18nc("@title:window", "Krita: Warning"),
i18n("You have an Intel(R) HD Graphics video adapter.\n"
"If you experience problems like a black or blank screen,"
"please update your display driver to the latest version.\n\n"
"You can also disable OpenGL rendering in Krita's Settings.\n"));
cfg.writeEntry("WarnedAboutIntel", true);
}
#endif
d->canvasInitialized = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment