mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 10:14:13 -05:00
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. https://github.com/obsproject/obs-studio/commit/f8d415afbee4873a3eb15c7e77833fbee6c87871
This commit is contained in:
+15
-11
@@ -33,17 +33,21 @@ protected:
|
||||
case QEvent::PlatformSurface:
|
||||
surfaceEvent =
|
||||
static_cast<QPlatformSurfaceEvent *>(event);
|
||||
if (surfaceEvent->surfaceEventType() !=
|
||||
QPlatformSurfaceEvent::SurfaceCreated)
|
||||
return result;
|
||||
|
||||
if (display->windowHandle()->isExposed())
|
||||
createOBSDisplay();
|
||||
else
|
||||
mTimerId = startTimer(67); // Arbitrary
|
||||
break;
|
||||
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
|
||||
display->DestroyDisplay();
|
||||
switch (surfaceEvent->surfaceEventType()) {
|
||||
case QPlatformSurfaceEvent::SurfaceCreated:
|
||||
if (display->windowHandle()->isExposed())
|
||||
createOBSDisplay();
|
||||
else
|
||||
mTimerId = startTimer(67); // Arbitrary
|
||||
break;
|
||||
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
|
||||
display->DestroyDisplay();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case QEvent::Expose:
|
||||
createOBSDisplay();
|
||||
@@ -55,7 +59,7 @@ protected:
|
||||
return result;
|
||||
}
|
||||
|
||||
void timerEvent(QTimerEvent *)
|
||||
void timerEvent(QTimerEvent *) override
|
||||
{
|
||||
createOBSDisplay(display->isVisible());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user