diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 41c385311ec2db03253331e3f93d59a662fcf96f..3fbc493e5d1db062b66bfb601941f02d28e75c66 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -205,6 +205,10 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) connect(this, SIGNAL(x11EventOccured(XEvent*)), mouse, SLOT(handleX11Event(XEvent*))); #endif //QGC_MOUSE_ENABLED_LINUX + // These also cause the screen to redraw so we need to update any OpenGL canvases in QML controls + connect(LinkManager::instance(), &LinkManager::linkConnected, this, &MainWindow::_linkStateChange); + connect(LinkManager::instance(), &LinkManager::linkDisconnected, this, &MainWindow::_linkStateChange); + // Connect link if (_autoReconnect) { @@ -1348,6 +1352,11 @@ void MainWindow::restoreLastUsedConnection() } } +void MainWindow::_linkStateChange(LinkInterface*) +{ + emit repaintCanvas(); +} + #ifdef QGC_MOUSE_ENABLED_LINUX bool MainWindow::x11Event(XEvent *event) { diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 7b38f98bde80e676cd40acb300a2be17af4444c8..5ea75fcf193757c0eef46d5f05a56870180bada1 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -294,6 +294,7 @@ private slots: void _showDockWidgetAction(bool show); void _loadCustomWidgetFromFile(void); void _createNewCustomWidget(void); + void _linkStateChange(LinkInterface*); #ifdef UNITTEST_BUILD void _showQmlTestWidget(void); #endif