Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions reader/widgets/ShortCutShow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "Global.h"
#include "DocSheet.h"

#include <DGuiApplicationHelper>

#include <QProcess>
#include <QDesktopWidget>
#include <QJsonDocument>
Expand All @@ -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;
Expand Down