From 170d52067b39c7bd2b7eb15425ca94ed41973fc4 Mon Sep 17 00:00:00 2001 From: Hane Date: Thu, 18 Apr 2024 16:42:28 +0200 Subject: [PATCH] wip: fixed multi monitor --- src/qt/qtclasses.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/qt/qtclasses.cpp b/src/qt/qtclasses.cpp index e7b3a26..478bd6f 100644 --- a/src/qt/qtclasses.cpp +++ b/src/qt/qtclasses.cpp @@ -91,19 +91,21 @@ void MainWindow::compose() { screenRes.getCoords(&srx1, &sry1, &srx2, &sry2); log_debugcpp("(for Percentage) Screen Res: " + std::to_string(srx1) + " " + std::to_string(srx2)+" " + std::to_string(sry1) + " " + std::to_string(sry2)); - uint64_t windowWidth = (uint64_t)std::abs(srx2) * this->widthRatio; - uint64_t screenHeight = (uint64_t)std::abs(sry2); + uint64_t windowWidth = (uint64_t)std::abs(screenRes.width()) * this->widthRatio; + uint64_t screenHeight = (uint64_t)std::abs(screenRes.height()); log_debugcpp("Window Width: " + std::to_string(windowWidth)); - for (auto *epw : ews) { - if (!epw) continue; - epw->setSize(windowWidth, screenHeight); - } this->setAttribute(Qt::WA_DontShowOnScreen, true); this->show(); this->widget->layout()->update(); this->hide(); this->setAttribute(Qt::WA_DontShowOnScreen, false); + + for (auto *epw : ews) { + if (!epw) continue; + epw->setSize(windowWidth, screenHeight); + log_debugcpp("epw loop"); + } /* * Calculating window height @@ -567,8 +569,10 @@ void EndpointWidget::setSize(uint64_t width, uint64_t height) { /* og 1080p 120% testing values */ this->mainLabel->setMaximumWidth((int)width * 0.35 /* 1080p 120%*/); this->mainLabel->setMinimumWidth((int)width * 0.35 /* 1080p 120%*/); - this->cw->setMinimumSize(QSize(1, height * 0.06)); - this->cw->setMaximumSize(QSize(QWIDGETSIZE_MAX, height * 0.06)); + if (cw) { + this->cw->setMinimumSize(QSize(1, height * 0.06)); + this->cw->setMaximumSize(QSize(QWIDGETSIZE_MAX, height * 0.06)); + } for (auto sw : sessionWidgets){ if (sw) sw->setSize(width, height); }