diff --git a/reader/widgets/ShortCutShow.cpp b/reader/widgets/ShortCutShow.cpp index af07b8e9..20f34565 100644 --- a/reader/widgets/ShortCutShow.cpp +++ b/reader/widgets/ShortCutShow.cpp @@ -8,6 +8,8 @@ #include "Global.h" #include "DocSheet.h" +#include + #include #include #include @@ -34,6 +36,18 @@ void ShortCutShow::show() { QRect rect = qApp->desktop()->geometry(); QPoint pos(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2); + // 获取当前焦点位置(光标所在屏幕中心) + QScreen *screen = nullptr; + if (DGuiApplicationHelper::isTabletEnvironment()) { + // bug 88079 避免屏幕旋转弹出位置错误 + screen = qApp->primaryScreen(); + } else { + screen = QGuiApplication::screenAt(QCursor::pos()); + } + + if (screen) { + pos = screen->geometry().center(); + } QJsonObject shortcutObj; QJsonArray jsonGroups;