| | |
| | | const WindowPart currentWindowPart = lastHitTestResult; |
| | | if (message == WM_NCMOUSEMOVE) { |
| | | if (currentWindowPart != WindowPart::ChromeButton) { |
| | | std::ignore = m_delegate->resetQtGrabbedControl(); |
| | | m_delegate->resetQtGrabbedControl(); |
| | | if (mouseLeaveBlocked) { |
| | | emulateClientAreaMessage(hWnd, message, wParam, lParam, |
| | | WM_NCMOUSELEAVE); |
| | |
| | | // window from client area, which means we will get previous window part as |
| | | // HTCLIENT if the mouse leaves window from client area and enters window |
| | | // from non-client area, but it has no bad effect. |
| | | std::ignore = m_delegate->resetQtGrabbedControl(); |
| | | m_delegate->resetQtGrabbedControl(); |
| | | } |
| | | } |
| | | break; |
| | |
| | | |
| | | WindowItemDelegate::~WindowItemDelegate() = default; |
| | | |
| | | bool WindowItemDelegate::resetQtGrabbedControl() const { |
| | | return true; |
| | | } |
| | | void WindowItemDelegate::resetQtGrabbedControl() const {} |
| | | |
| | | } |
| | |
| | | virtual bool isHostSizeFixed(const QObject *host) const = 0; |
| | | |
| | | // Callbacks |
| | | virtual bool resetQtGrabbedControl() const; |
| | | virtual void resetQtGrabbedControl() const; |
| | | |
| | | private: |
| | | Q_DISABLE_COPY_MOVE(WindowItemDelegate) |
| | |
| | | return false; |
| | | } |
| | | |
| | | bool WidgetItemDelegate::resetQtGrabbedControl() const { |
| | | if (qt_button_down) { |
| | | void WidgetItemDelegate::resetQtGrabbedControl() const { |
| | | if (!qt_button_down) { |
| | | return; |
| | | } |
| | | static constexpr const auto invalidPos = QPoint{std::numeric_limits<int>::lowest(), std::numeric_limits<int>::lowest()}; |
| | | const auto event = |
| | | new QMouseEvent(QEvent::MouseButtonRelease, invalidPos, invalidPos, invalidPos, |
| | |
| | | QGuiApplication::keyboardModifiers()); |
| | | QApplication::postEvent(qt_button_down, event); |
| | | qt_button_down = nullptr; |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
| | |
| | | QWindow * hostWindow(const QObject *host) const override; |
| | | bool isHostSizeFixed(const QObject *host) const override; |
| | | |
| | | bool resetQtGrabbedControl() const override; |
| | | void resetQtGrabbedControl() const override; |
| | | }; |
| | | |
| | | } |