Changeset View
Changeset View
Standalone View
Standalone View
effects/presentwindows/presentwindows.cpp
Show First 20 Lines • Show All 532 Lines • ▼ Show 20 Line(s) | |||||
533 | } | 533 | } | ||
534 | 534 | | |||
535 | void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) | 535 | void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) | ||
536 | { | 536 | { | ||
537 | QMouseEvent* me = dynamic_cast< QMouseEvent* >(e); | 537 | QMouseEvent* me = dynamic_cast< QMouseEvent* >(e); | ||
538 | if (!me) { | 538 | if (!me) { | ||
539 | return; | 539 | return; | ||
540 | } | 540 | } | ||
541 | me->setAccepted(false); | ||||
zzag: Wouldn't it be better to check `QEvent::isAccepted()` in `EffectsHandlerImpl… | |||||
Urgh, no, it seems like n effects can do mouse interception by design, please ignore me. zzag: Urgh, no, it seems like n effects can do mouse interception by design, please ignore me. | |||||
541 | if (m_closeView) { | 542 | if (m_closeView) { | ||
542 | const bool contains = m_closeView->geometry().contains(me->pos()); | 543 | const bool contains = m_closeView->geometry().contains(me->pos()); | ||
543 | if (!m_closeView->isVisible() && contains) { | 544 | if (!m_closeView->isVisible() && contains) { | ||
544 | updateCloseWindow(); | 545 | updateCloseWindow(); | ||
545 | } | 546 | } | ||
546 | m_closeView->forwardMouseEvent(e); | 547 | m_closeView->forwardMouseEvent(e); | ||
547 | } | 548 | } | ||
549 | if (e->isAccepted()) { | ||||
550 | return; | ||||
551 | } | ||||
548 | inputEventUpdate(me->pos(), me->type(), me->button()); | 552 | inputEventUpdate(me->pos(), me->type(), me->button()); | ||
549 | } | 553 | } | ||
550 | 554 | | |||
551 | void PresentWindowsEffect::inputEventUpdate(const QPoint &pos, QEvent::Type type, Qt::MouseButton button) | 555 | void PresentWindowsEffect::inputEventUpdate(const QPoint &pos, QEvent::Type type, Qt::MouseButton button) | ||
552 | { | 556 | { | ||
553 | // Which window are we hovering over? Always trigger as we don't always get move events before clicking | 557 | // Which window are we hovering over? Always trigger as we don't always get move events before clicking | ||
554 | // We cannot use m_motionManager.windowAtPoint() as the window might not be visible | 558 | // We cannot use m_motionManager.windowAtPoint() as the window might not be visible | ||
555 | EffectWindowList windows = m_motionManager.managedWindows(); | 559 | EffectWindowList windows = m_motionManager.managedWindows(); | ||
▲ Show 20 Lines • Show All 1407 Lines • Show Last 20 Lines |
Wouldn't it be better to check QEvent::isAccepted() in EffectsHandlerImpl::checkInputWindowEvent()?