Skip to content

Commit a973746

Browse files
committed
check window only when pressing mouse button
1 parent aaa4f60 commit a973746

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/framework/dockwindow/thirdparty/KDDockWidgets/src/private/WidgetResizeHandler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ bool WidgetResizeHandler::eventFilter(QObject *o, QEvent *e)
9090
if (m_isTopLevelWindowResizer && (!widget->isTopLevel() || o != mTarget))
9191
return false;
9292

93-
// Get the window under the cursor and check if it's our target window
94-
QWindow *windowUnderCursor = qApp->topLevelAt(QCursor::pos());
95-
if (!windowUnderCursor || (windowUnderCursor != widget->window()->windowHandle()))
96-
return false;
97-
9893
switch (e->type()) {
9994
case QEvent::MouseButtonPress: {
10095
if (mTarget->isMaximized())
10196
break;
10297

98+
// Get the window under the cursor and check if it's our target window
99+
QWindow *windowUnderCursor = qApp->topLevelAt(QCursor::pos());
100+
if (!windowUnderCursor || (windowUnderCursor != widget->window()->windowHandle()))
101+
return false;
102+
103103
auto mouseEvent = static_cast<QMouseEvent *>(e);
104104
auto cursorPos = cursorPosition(Qt5Qt6Compat::eventGlobalPos(mouseEvent));
105105
updateCursor(cursorPos);

0 commit comments

Comments
 (0)