[effects] Don't assume windowInputMouseEvents only carries QMouseEvents

A QEvent* is passed around, this could also be a QWheelEvent. Only
present windows static casted, all other effects verified.

Documentation is not existing, so we don't know what was intended.
This commit is contained in:
Martin Gräßlin 2016-03-04 14:12:29 +01:00
parent 5cfadf72a1
commit 7718b6dce3

View file

@ -533,7 +533,10 @@ bool PresentWindowsEffect::borderActivated(ElectricBorder border)
void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) void PresentWindowsEffect::windowInputMouseEvent(QEvent *e)
{ {
QMouseEvent* me = static_cast< QMouseEvent* >(e); QMouseEvent* me = dynamic_cast< QMouseEvent* >(e);
if (!me) {
return;
}
if (m_closeView) { if (m_closeView) {
const bool contains = m_closeView->geometry().contains(me->pos()); const bool contains = m_closeView->geometry().contains(me->pos());
if (!m_closeView->isVisible() && contains) { if (!m_closeView->isVisible() && contains) {