Skip to content

Commit

Permalink
fix: 贴图不能移动出屏幕
Browse files Browse the repository at this point in the history
截屏贴图-触发贴图后滑动鼠标滚轮缩放,窗口不能超出屏幕

Log:  截屏贴图-触发贴图后滑动鼠标滚轮缩放,窗口不能超出屏幕
Bug: https://pms.uniontech.com/bug-view-254799.html
  • Loading branch information
add-uos committed Jun 13, 2024
1 parent a427559 commit 2b438cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pin_screenshots/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void MainWindow::initMainWindow()
{
m_ocrInterface = nullptr;
//去菜单栏,置顶窗口
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::BypassWindowManagerHint);

//设置可以进行鼠标操作
setMouseTracking(true);
Expand Down Expand Up @@ -387,9 +387,9 @@ void MainWindow::mouseMoveEvent(QMouseEvent *event)
this->setCursor(QCursor(Qt::ClosedHandCursor));
//qDebug() << "=============event->globalPos()" << event->globalPos() << "dragPosition" << dragPosition;
QPoint globalPoint = event->globalPos() - dragPosition;
if (PUtils::isWaylandMode && globalPoint.y() < 0) {
globalPoint.setY(0);
}
// if (PUtils::isWaylandMode && globalPoint.y() < 0) {
// globalPoint.setY(0);
// }
move(globalPoint);
event->accept();
}
Expand Down

0 comments on commit 2b438cd

Please sign in to comment.