From 7daca5ff9034be2d2c63470723f089c96d9ca5fa Mon Sep 17 00:00:00 2001 From: Mantas-2155X Date: Mon, 25 Jan 2021 16:51:09 +0200 Subject: [PATCH] * Show the Help Text, Tool Settings on the current active monitor --- src/widgets/capture/capturewidget.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 9722cf16..e3276625 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -323,7 +323,7 @@ void CaptureWidget::paintEvent(QPaintEvent*) if (m_showInitialMsg) { #if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ - defined(Q_OS_MACX)) + defined(Q_OS_MACX) || defined(Q_OS_LINUX)) QRect helpRect; QScreen* currentScreen = QGuiApplication::screenAt(QCursor::pos()); if (currentScreen) { @@ -712,11 +712,24 @@ void CaptureWidget::initPanel() { QRect panelRect = rect(); if (m_context.fullscreen) { +#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ + defined(Q_OS_MACX) || defined(Q_OS_LINUX)) + QScreen* currentScreen = QGuiApplication::screenAt(QCursor::pos()); + if (currentScreen) { + panelRect = currentScreen->geometry(); + auto devicePixelRatio = currentScreen->devicePixelRatio(); + panelRect.moveTo(panelRect.x() / devicePixelRatio, panelRect.y() / devicePixelRatio); + + } else { + panelRect = QGuiApplication::primaryScreen()->geometry(); + auto devicePixelRatio = QGuiApplication::primaryScreen()->devicePixelRatio(); + panelRect.moveTo(panelRect.x() / devicePixelRatio, panelRect.y() / devicePixelRatio); + } +#else panelRect = QGuiApplication::primaryScreen()->geometry(); - auto devicePixelRatio = - QGuiApplication::primaryScreen()->devicePixelRatio(); - panelRect.moveTo(panelRect.x() / devicePixelRatio, - panelRect.y() / devicePixelRatio); + auto devicePixelRatio = QGuiApplication::primaryScreen()->devicePixelRatio(); + panelRect.moveTo(panelRect.x() / devicePixelRatio, panelRect.y() / devicePixelRatio); +#endif } ConfigHandler config;