From 0ec732491b82c539e5492c96c150db117bcb1a5b Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 8 Nov 2022 19:42:47 +0200 Subject: [PATCH] Port PopupInputFilter to Window::clientGeometry() Saves us some math operations. --- src/popup_input_filter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/popup_input_filter.cpp b/src/popup_input_filter.cpp index 7698199d6c..a5a59b4b0f 100644 --- a/src/popup_input_filter.cpp +++ b/src/popup_input_filter.cpp @@ -56,8 +56,7 @@ bool PopupInputFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) } if (pointerFocus && pointerFocus->isDecorated()) { // test whether it is on the decoration - const QRectF clientRect = QRectF(pointerFocus->clientPos(), pointerFocus->clientSize()).translated(pointerFocus->pos()); - if (!clientRect.contains(event->globalPos())) { + if (!pointerFocus->clientGeometry().contains(event->globalPos())) { cancelPopups(); return true; } @@ -102,8 +101,7 @@ bool PopupInputFilter::touchDown(qint32 id, const QPointF &pos, quint32 time) } if (pointerFocus && pointerFocus->isDecorated()) { // test whether it is on the decoration - const QRectF clientRect = QRectF(pointerFocus->clientPos(), pointerFocus->clientSize()).translated(pointerFocus->pos()); - if (!clientRect.contains(pos)) { + if (!pointerFocus->clientGeometry().contains(pos)) { cancelPopups(); return true; }