Port PopupInputFilter to Window::clientGeometry()
Saves us some math operations.
This commit is contained in:
parent
5e04977d31
commit
0ec732491b
1 changed files with 2 additions and 4 deletions
|
@ -56,8 +56,7 @@ bool PopupInputFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton)
|
||||||
}
|
}
|
||||||
if (pointerFocus && pointerFocus->isDecorated()) {
|
if (pointerFocus && pointerFocus->isDecorated()) {
|
||||||
// test whether it is on the decoration
|
// test whether it is on the decoration
|
||||||
const QRectF clientRect = QRectF(pointerFocus->clientPos(), pointerFocus->clientSize()).translated(pointerFocus->pos());
|
if (!pointerFocus->clientGeometry().contains(event->globalPos())) {
|
||||||
if (!clientRect.contains(event->globalPos())) {
|
|
||||||
cancelPopups();
|
cancelPopups();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -102,8 +101,7 @@ bool PopupInputFilter::touchDown(qint32 id, const QPointF &pos, quint32 time)
|
||||||
}
|
}
|
||||||
if (pointerFocus && pointerFocus->isDecorated()) {
|
if (pointerFocus && pointerFocus->isDecorated()) {
|
||||||
// test whether it is on the decoration
|
// test whether it is on the decoration
|
||||||
const QRectF clientRect = QRectF(pointerFocus->clientPos(), pointerFocus->clientSize()).translated(pointerFocus->pos());
|
if (!pointerFocus->clientGeometry().contains(pos)) {
|
||||||
if (!clientRect.contains(pos)) {
|
|
||||||
cancelPopups();
|
cancelPopups();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue