1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Add a quick check for OpenGL support in QGLFormat before initialising ProjectM visualisations. Might fix a crash when OpenGL is unavailable. Fixes issue 2741

This commit is contained in:
David Sansome 2012-03-12 21:26:19 +00:00
parent 69779374c2
commit e3b88a72db

View File

@ -29,6 +29,7 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QMenu>
#include <QMessageBox>
#include <QSettings>
#include <QShortcut>
#include <QSignalMapper>
@ -138,6 +139,13 @@ void VisualisationContainer::SetEngine(GstEngine* engine) {
void VisualisationContainer::showEvent(QShowEvent* e) {
if (!initialised_) {
if (!QGLFormat::hasOpenGL()) {
hide();
QMessageBox::warning(this, tr("Clementine Visualization"),
tr("Your system is missing OpenGL support, visualizations are unavailable."),
QMessageBox::Close);
return;
}
Init();
initialised_ = true;
}