Menus freeze application temporarily
-
When I first run the application, if I bring up a menu (context, or menubar) then hide that menu (by moving to the next menu, or clicking outside the menu) it causes the application to freeze for a couple of seconds. After some investigation it appears to be trying to clean up a pbuffer object when the menu is closed, but it first creates a new QOffscreenSurface to do so. Once all the menus have created their fallback surfaces everything progresses better. Still isn't as smooth as native menus but its good enough.
9 ?? /usr/lib/nvidia-346/libGL.so.1 0x7ffff291eba2 10 glXCreatePbuffer /usr/lib/nvidia-346/libGL.so.1 0x7ffff291a868 11 QGLXPbuffer::QGLXPbuffer qglxintegration.cpp 709 0x7fffe2092c0b 12 QXcbIntegration::createPlatformOffscreenSurface qxcbintegration.cpp 290 0x7fffe20574e0 13 QOffscreenSurface::create qoffscreensurface.cpp 169 0x7ffff385f279 14 QSGThreadedRenderLoop::releaseResources qsgthreadedrenderloop.cpp 1049 0x7ffff6b9d0a7 15 QSGThreadedRenderLoop::windowDestroyed qsgthreadedrenderloop.cpp 820 0x7ffff6b9b95e 16 QQuickWindow::~QQuickWindow qquickwindow.cpp 1111 0x7ffff6bd592d 17 QQuickPopupWindow::~QQuickPopupWindow qquickpopupwindow_p.h 43 0x7fffd5edaa4c 18 QQuickMenuPopupWindow::~QQuickMenuPopupWindow qquickmenupopupwindow_p.h 41 0x7fffd5f05389 19 QQuickMenuPopupWindow::~QQuickMenuPopupWindow qquickmenupopupwindow_p.h 41 0x7fffd5f053c2 20 qDeleteInEventHandler qobject.cpp 4391 0x7ffff34803b5
Specifically this bit of code which creates a new pbuffer every time the popup window closes
if (!window->handle()) { qCDebug(QSG_LOG_RENDERLOOP) << "- using fallback surface"; fallback = new QOffscreenSurface(); fallback->setFormat(w->actualWindowFormat); fallback->create(); }