From a49c5648919a0bd2d8206ae7fb5033c9f84e0a86 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 22 Feb 2019 08:19:01 +0100 Subject: Implement support for WA_MacNoClickThrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is done by adding a QWindowPrivate::allowsClickThrough() function, so this could easily be adapted later on if desired for other platforms. Fixes: QTBUG-41126 Change-Id: I1157e5e7e7667ff11d1a5d21b3ce8c4b13202272 Reviewed-by: Morten Johan Sørvig --- src/widgets/kernel/qwidgetwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/widgets/kernel/qwidgetwindow.cpp') diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index c6f22aa21a..f44f63d71b 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -106,6 +106,7 @@ public: if (QWidget *widget = q->widget()) QWidgetPrivate::get(widget)->updateContentsRect(); } + bool allowClickThrough(const QPoint &) const override; }; QRectF QWidgetWindowPrivate::closestAcceptableGeometry(const QRectF &rect) const @@ -221,6 +222,12 @@ static inline bool shouldBePropagatedToWidget(QEvent *event) } } +bool QWidgetWindowPrivate::allowClickThrough(const QPoint &globalPos) const +{ + QWidget *w = QApplication::widgetAt(globalPos); + return w && !w->testAttribute(Qt::WA_MacNoClickThrough); +} + bool QWidgetWindow::event(QEvent *event) { if (!m_widget) -- cgit v1.2.3