From 7718b6dce3bebfd9fdff2da07ffc006a584c6357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 4 Mar 2016 14:12:29 +0100 Subject: [PATCH] [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. --- effects/presentwindows/presentwindows.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index c2fa30579e..030dfadb32 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -533,7 +533,10 @@ bool PresentWindowsEffect::borderActivated(ElectricBorder border) void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) { - QMouseEvent* me = static_cast< QMouseEvent* >(e); + QMouseEvent* me = dynamic_cast< QMouseEvent* >(e); + if (!me) { + return; + } if (m_closeView) { const bool contains = m_closeView->geometry().contains(me->pos()); if (!m_closeView->isVisible() && contains) {