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-261679.html
Change-Id: Ib4fd873f9f6e9e76cd851ddef3d459bdc16af1cf
  • Loading branch information
tanjingdong authored and 18202781743 committed Aug 12, 2024
1 parent 7f57343 commit 288d2e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions xcb/dnotitlebarwindowhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ DPP_BEGIN_NAMESPACE

QHash<const QWindow*, DNoTitlebarWindowHelper*> DNoTitlebarWindowHelper::mapped;

static QHash<DNoTitlebarWindowHelper*, QPointF> g_pressPoint;

DNoTitlebarWindowHelper::DNoTitlebarWindowHelper(QWindow *window, quint32 windowID)
: QObject(window)
, m_window(window)
Expand Down Expand Up @@ -75,6 +77,8 @@ DNoTitlebarWindowHelper::DNoTitlebarWindowHelper(QWindow *window, quint32 window

DNoTitlebarWindowHelper::~DNoTitlebarWindowHelper()
{
g_pressPoint.remove(this);

if (VtableHook::hasVtable(m_window)) {
VtableHook::resetVtable(m_window);
}
Expand Down Expand Up @@ -505,7 +509,7 @@ bool DNoTitlebarWindowHelper::windowEvent(QEvent *event)
// keeping the moving state, we can just reset ti back to normal.
if (event->type() == QEvent::MouseButtonPress) {
self->m_windowMoving = false;
m_pressPoint = dynamic_cast<QMouseEvent*>(event)->globalPos();
g_pressPoint[this] = dynamic_cast<QMouseEvent*>(event)->globalPos();
}

if (is_mouse_move && !event->isAccepted()) {
Expand All @@ -515,7 +519,7 @@ bool DNoTitlebarWindowHelper::windowEvent(QEvent *event)
return ret;
}

QPointF delta = me->globalPos() - m_pressPoint;
QPointF delta = me->globalPos() - g_pressPoint[this];
if (delta.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) {
return ret;
}
Expand Down
1 change: 0 additions & 1 deletion xcb/dnotitlebarwindowhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ private slots:
bool m_enableBlurWindow = false;
bool m_autoInputMaskByClipPath = false;
DNativeSettings *m_settings;
QPointF m_pressPoint{0, 0};

static QHash<const QWindow*, DNoTitlebarWindowHelper*> mapped;

Expand Down

0 comments on commit 288d2e0

Please sign in to comment.