diff --git a/ui/gl/gl_surface.cpp b/ui/gl/gl_surface.cpp index 3900b07..64f3bcb 100644 --- a/ui/gl/gl_surface.cpp +++ b/ui/gl/gl_surface.cpp @@ -38,7 +38,6 @@ private: const std::unique_ptr _renderer; QMetaObject::Connection _connection; QSize _deviceSize; - bool _inPaintEvent = false; }; @@ -85,16 +84,10 @@ void SurfaceOpenGL::resizeGL(int w, int h) { } void SurfaceOpenGL::paintEvent(QPaintEvent *e) { - if (_inPaintEvent) { - return; - } - _inPaintEvent = true; if (_deviceSize != size() * devicePixelRatio()) { - QResizeEvent event = { size(), size() }; - resizeEvent(&event); + QCoreApplication::postEvent(this, new QResizeEvent(size(), size())); } QOpenGLWidget::paintEvent(e); - _inPaintEvent = false; } void SurfaceOpenGL::paintGL() {