UI: Properly apply hide cursor on fullscreen projectors

If a projector was created fullscreen, the isFullScreen() call would
fail since the window hasn't been displayed by Qt yet, resulting in the
cursor hiding choice not being applied. This moves the cursor hiding
into the SetMonitor call which is used for all code paths creating a
fullscreen projector, ensuring the setting is applied.

Fixes https://github.com/obsproject/obs-studio/issues/2687
This commit is contained in:
Richard Stanway
2020-04-10 00:29:40 +02:00
parent da35310363
commit dca5f2fcdb

View File

@@ -58,9 +58,6 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
connect(this, &OBSQTDisplay::DisplayCreated, addDrawCallback);
if (isFullScreen())
SetHideCursor();
if (type == ProjectorType::Multiview) {
obs_enter_graphics();
@@ -171,6 +168,7 @@ void OBSProjector::SetMonitor(int monitor)
QScreen *screen = QGuiApplication::screens()[monitor];
showFullScreen();
setGeometry(screen->geometry());
SetHideCursor();
}
void OBSProjector::SetHideCursor()
@@ -1034,7 +1032,6 @@ void OBSProjector::OpenFullScreenProjector()
int monitor = sender()->property("monitor").toInt();
SetMonitor(monitor);
SetHideCursor();
UpdateProjectorTitle(QT_UTF8(obs_source_get_name(source)));
}