From cf0987a100b1adc12ebd49dd740a2ba2fcbc2170 Mon Sep 17 00:00:00 2001 From: ArchieMeng Date: Thu, 7 Sep 2023 15:53:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E5=85=89=E6=A0=87=E6=89=80?= =?UTF-8?q?=E5=9C=A8=E5=B1=8F=E5=B9=95=E5=94=A4=E8=B5=B7=E9=9B=B7=E7=A5=9E?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=20(#294)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前雷神窗口只能够在主屏唤起。当前提交使得雷神窗口可以在任意光标所在的屏幕上被唤起。 Issue: https://github.com/linuxdeepin/developer-center/issues/5455 Log: 在光标所在屏幕唤起雷神窗口 Signed-off-by: Yutao Meng --- src/main/windowsmanager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/windowsmanager.cpp b/src/main/windowsmanager.cpp index 9a69b4245..85040ba44 100644 --- a/src/main/windowsmanager.cpp +++ b/src/main/windowsmanager.cpp @@ -10,6 +10,7 @@ #include "define.h" #include +#include WindowsManager *WindowsManager::pManager = new WindowsManager(); WindowsManager *WindowsManager::instance() @@ -30,6 +31,9 @@ void WindowsManager::runQuakeWindow(TermProperties properties) m_quakeWindow->activateWindow(); return; } + // 雷神窗口移动到光标所在的屏幕 + QPoint cursorPoint = QCursor::pos(); + m_quakeWindow->move(QGuiApplication::screenAt(cursorPoint)->geometry().topLeft()); // Alt+F2的显隐功能实现点 quakeWindowShowOrHide(); }