Commit 5d2b4cc5 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix monitor fullscreen in some cases and don't lose focus (broke shortcuts)

parent d1908120
...@@ -776,10 +776,11 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly) ...@@ -776,10 +776,11 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly)
// Move monitor widget to the second screen (one screen for Kdenlive, the other one for the Monitor widget) // Move monitor widget to the second screen (one screen for Kdenlive, the other one for the Monitor widget)
if (qApp->screens().count() > 1) { if (qApp->screens().count() > 1) {
for (auto screen : qApp->screens()) { for (auto screen : qApp->screens()) {
if (screen != qApp->screenAt(pCore->window()->geometry().center())) { QRect screenRect = screen->availableGeometry();
QRect rect = screen->availableGeometry(); if (!screenRect.contains(pCore->window()->geometry().center())) {
m_glWidget->setParent(nullptr); m_glWidget->setParent(nullptr);
m_glWidget->move(this->parentWidget()->mapFromGlobal(rect.center())); m_glWidget->move(this->parentWidget()->mapFromGlobal(screenRect.center()));
m_glWidget->setGeometry(screenRect);
break; break;
} }
} }
...@@ -787,6 +788,7 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly) ...@@ -787,6 +788,7 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly)
m_glWidget->setParent(nullptr); m_glWidget->setParent(nullptr);
} }
m_glWidget->showFullScreen(); m_glWidget->showFullScreen();
qApp->activeWindow()->setFocus();
} else { } else {
m_glWidget->showNormal(); m_glWidget->showNormal();
auto *lay = (QVBoxLayout *)layout(); auto *lay = (QVBoxLayout *)layout();
......
Markdown is supported
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