UI: Fix close display before native surfaces

A QPlatformSurfaceEvent constant is used in a switch that only accept
QEvent type.

timerEvent() is missing the override keyword.

f8d415afbe
master
tytan652 2022-07-28 12:16:28 +02:00 committed by Jim
parent 2e6dcc7f17
commit 91c46af767
1 changed files with 15 additions and 11 deletions

View File

@ -33,17 +33,21 @@ protected:
case QEvent::PlatformSurface: case QEvent::PlatformSurface:
surfaceEvent = surfaceEvent =
static_cast<QPlatformSurfaceEvent *>(event); static_cast<QPlatformSurfaceEvent *>(event);
if (surfaceEvent->surfaceEventType() !=
QPlatformSurfaceEvent::SurfaceCreated)
return result;
if (display->windowHandle()->isExposed()) switch (surfaceEvent->surfaceEventType()) {
createOBSDisplay(); case QPlatformSurfaceEvent::SurfaceCreated:
else if (display->windowHandle()->isExposed())
mTimerId = startTimer(67); // Arbitrary createOBSDisplay();
break; else
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed: mTimerId = startTimer(67); // Arbitrary
display->DestroyDisplay(); break;
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
display->DestroyDisplay();
break;
default:
break;
}
break; break;
case QEvent::Expose: case QEvent::Expose:
createOBSDisplay(); createOBSDisplay();
@ -55,7 +59,7 @@ protected:
return result; return result;
} }
void timerEvent(QTimerEvent *) void timerEvent(QTimerEvent *) override
{ {
createOBSDisplay(display->isVisible()); createOBSDisplay(display->isVisible());
} }