Skip to content

Commit

Permalink
fix: no leave event when window hide
Browse files Browse the repository at this point in the history
Change-Id: I839d5d7dca2f755dda5dea24091996f125815abd
  • Loading branch information
zccrs committed Mar 8, 2018
1 parent f48df4c commit a2bd249
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platformplugin/dplatformwindowhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,11 @@ bool DPlatformWindowHelper::eventFilter(QObject *watched, QEvent *event)
}
break;
case QEvent::Leave: {
QWindow::Visibility visibility = m_nativeWindow->window()->visibility();

if (visibility == QWindow::Hidden || visibility == QWindow::Minimized)
break;

const QPoint &pos = Utility::translateCoordinates(QPoint(0, 0), m_nativeWindow->winId(),
DPlatformIntegration::instance()->defaultConnection()->rootWindow());
const QPoint &cursor_pos = qApp->primaryScreen()->handle()->cursor()->pos();
Expand Down

0 comments on commit a2bd249

Please sign in to comment.