Get media viewer screen by checking the screen by active window position
QWindow::screen seem to be buggy on Windows and doesn't always follow window moves
This commit is contained in:
parent
b32b10a4e1
commit
4e090fcfda
|
@ -481,7 +481,16 @@ void OverlayWidget::refreshLang() {
|
||||||
|
|
||||||
void OverlayWidget::moveToScreen(bool inMove) {
|
void OverlayWidget::moveToScreen(bool inMove) {
|
||||||
const auto widgetScreen = [&](auto &&widget) -> QScreen* {
|
const auto widgetScreen = [&](auto &&widget) -> QScreen* {
|
||||||
if (auto handle = widget ? widget->windowHandle() : nullptr) {
|
if (!widget) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
if (!Platform::IsWayland()) {
|
||||||
|
if (const auto screen = QGuiApplication::screenAt(
|
||||||
|
widget->geometry().center())) {
|
||||||
|
return screen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (const auto handle = widget->windowHandle()) {
|
||||||
return handle->screen();
|
return handle->screen();
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue