Skip to content

Commit

Permalink
Fix-mirror-crash-under-wayland (cyberbotics#6644)
Browse files Browse the repository at this point in the history
* Use format() instead of cMainOpenGLContext->format() or requestedFormat() when creating context that will be shared.

* Create rendering device window with the same format as used by the main OpenGLContext so that they are compatible.
  • Loading branch information
brettle authored Aug 27, 2024
1 parent ea41196 commit 8d0ecd7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/webots/gui/WbRenderingDeviceWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ WbRenderingDeviceWindow::WbRenderingDeviceWindow(WbRenderingDevice *device) :
mUpdateRequested(true),
mShowOverlayOnClose(true) {
setSurfaceType(QWindow::OpenGLSurface);
QSurfaceFormat surfaceFormat = format();
surfaceFormat.setMajorVersion(3);
surfaceFormat.setMinorVersion(3);
assert(cMainOpenGLContext);
QSurfaceFormat surfaceFormat = cMainOpenGLContext->format();
setFormat(surfaceFormat);

mAbstractCamera = dynamic_cast<WbAbstractCamera *>(mDevice);
Expand Down

0 comments on commit 8d0ecd7

Please sign in to comment.