diff --git a/src/popup_input_filter.cpp b/src/popup_input_filter.cpp index 71d2b609d9..9ea6e32b05 100644 --- a/src/popup_input_filter.cpp +++ b/src/popup_input_filter.cpp @@ -48,9 +48,8 @@ bool PopupInputFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) return false; } if (event->type() == QMouseEvent::MouseButtonPress) { - auto t = input()->findToplevel(event->globalPos()); - auto pointerFocus = static_cast(t && t->isClient() ? t : nullptr); - if (!pointerFocus || !AbstractClient::belongToSameApplication(pointerFocus, static_cast(m_popupClients.constLast()->isClient() ? m_popupClients.constLast() : nullptr))) { + auto pointerFocus = input()->findToplevel(event->globalPos()); + if (!pointerFocus || !AbstractClient::belongToSameApplication(pointerFocus, m_popupClients.constLast())) { // a press on a window (or no window) not belonging to the popup window cancelPopups(); // filter out this press @@ -97,9 +96,8 @@ bool PopupInputFilter::touchDown(qint32 id, const QPointF &pos, quint32 time) if (m_popupClients.isEmpty()) { return false; } - auto t = input()->findToplevel(pos.toPoint()); - auto pointerFocus = static_cast(t && t->isClient() ? t : nullptr); - if (!pointerFocus || !AbstractClient::belongToSameApplication(pointerFocus, static_cast(m_popupClients.constLast()->isClient() ? m_popupClients.constLast() : nullptr))) { + auto pointerFocus = input()->findToplevel(pos.toPoint()); + if (!pointerFocus || !AbstractClient::belongToSameApplication(pointerFocus, m_popupClients.constLast())) { // a touch on a window (or no window) not belonging to the popup window cancelPopups(); // filter out this touch