Remove AbstractClient plumbing casts in PopupInputFilter
This commit is contained in:
parent
94bbe14f4c
commit
9157b1303e
1 changed files with 4 additions and 6 deletions
|
@ -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<AbstractClient *>(t && t->isClient() ? t : nullptr);
|
||||
if (!pointerFocus || !AbstractClient::belongToSameApplication(pointerFocus, static_cast<AbstractClient *>(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<AbstractClient *>(t && t->isClient() ? t : nullptr);
|
||||
if (!pointerFocus || !AbstractClient::belongToSameApplication(pointerFocus, static_cast<AbstractClient *>(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
|
||||
|
|
Loading…
Reference in a new issue