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:
parent
69779374c2
commit
e3b88a72db
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user