Browse Source

Merge pull request #1394 from dogmaphobic/fixToolbarCanvas

Fix redraw issues with OpenGL canvases when link states change.
QGC4.4
Don Gagne 10 years ago
parent
commit
63b5bd32d1
  1. 9
      src/ui/MainWindow.cc
  2. 1
      src/ui/MainWindow.h

9
src/ui/MainWindow.cc

@ -205,6 +205,10 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) @@ -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() @@ -1348,6 +1352,11 @@ void MainWindow::restoreLastUsedConnection()
}
}
void MainWindow::_linkStateChange(LinkInterface*)
{
emit repaintCanvas();
}
#ifdef QGC_MOUSE_ENABLED_LINUX
bool MainWindow::x11Event(XEvent *event)
{

1
src/ui/MainWindow.h

@ -294,6 +294,7 @@ private slots: @@ -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

Loading…
Cancel
Save