Commit 79eade13 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix fullscreen monitor selection doesn't work on Windows

Related to #1390
parent ea7791f5
Pipeline #158707 passed with stage
in 12 minutes and 51 seconds
......@@ -743,8 +743,16 @@ void KdenliveSettingsDialog::initDevices()
QSignalBlocker bk(m_configSdl.fullscreen_monitor);
m_configSdl.fullscreen_monitor->clear();
m_configSdl.fullscreen_monitor->addItem(i18n("auto"));
int ix = 0;
for (const QScreen* screen : qApp->screens()) {
#ifdef Q_OS_WIN
// Screen manufacturer, model and serial don't work under Windows
m_configSdl.fullscreen_monitor->addItem(QString("%1: %2").arg(QString::number(ix), screen->name()), QString::number(ix));
ix++;
#else
m_configSdl.fullscreen_monitor->addItem(QString("%1 %2 (%3)").arg(screen->manufacturer(), screen->model(), screen->name()), screen->serialNumber());
#endif
}
if (!KdenliveSettings::fullscreen_monitor().isEmpty()) {
int ix = m_configSdl.fullscreen_monitor->findData(KdenliveSettings::fullscreen_monitor());
......
......@@ -989,9 +989,15 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly)
// Move monitor widget to the second screen (one screen for Kdenlive, the other one for the Monitor widget)
if (qApp->screens().count() > 1) {
bool screenFound = false;
int ix = -1;
if (!KdenliveSettings::fullscreen_monitor().isEmpty()) {
for (const QScreen* screen : qApp->screens()) {
#ifdef Q_OS_WIN
ix++;
if (QString::number(ix) == KdenliveSettings::fullscreen_monitor()) {
#else
if (screen->serialNumber() == KdenliveSettings::fullscreen_monitor()) {
#endif
// Match
m_glWidget->setParent(nullptr);
m_glWidget->move(screen->geometry().topLeft());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment