From 9157b1303e285255d867d495fdc314ad766180e0 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 18 Apr 2022 11:04:18 +0300 Subject: [PATCH] Remove AbstractClient plumbing casts in PopupInputFilter --- src/popup_input_filter.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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