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
16 changes: 15 additions & 1 deletion src/pin_screenshots/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
#include "../utils/log.h"

#include <QDebug>
#include <QDBusInterface>

Check warning on line 12 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusInterface> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QScreen>

Check warning on line 13 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QScreen> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QGuiApplication>

Check warning on line 14 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QGuiApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QApplication>

Check warning on line 15 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QClipboard>

Check warning on line 16 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QClipboard> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QFileDialog>

Check warning on line 17 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QFileDialog> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QStandardPaths>

Check warning on line 18 in src/pin_screenshots/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QStandardPaths> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QTimer>

#define MOVENUM 1
Expand Down Expand Up @@ -909,7 +910,20 @@
}

const QPoint globalPos = QCursor::pos();
const bool mouseOnMainWindow = this->geometry().contains(globalPos);

// 检查鼠标是否在当前窗口的几何范围内
bool mouseOnMainWindow = this->geometry().contains(globalPos);
// 防止多个贴图重叠时,底层窗口工具栏不消失的问题
if (mouseOnMainWindow) {
QWidget *topWidget = QApplication::widgetAt(globalPos);
if (topWidget) {
QWidget *topWindow = topWidget->window();
if (topWindow != this && topWindow != m_toolBar) {
mouseOnMainWindow = false;
}
}
}

const bool mouseOnToolBar = m_toolBar && m_toolBar->isVisible() && m_toolBar->geometry().contains(globalPos);

bool mouseOnMenu = false;
Expand Down