diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index ed5942eff0..64b4901cf6 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -193,6 +193,7 @@ void AuroraeClient::init() createMainWidget(); widget()->setAttribute(Qt::WA_TranslucentBackground); widget()->setAttribute(Qt::WA_NoSystemBackground); + widget()->installEventFilter(this); m_view = new QGraphicsView(m_scene, widget()); m_view->setAttribute(Qt::WA_TranslucentBackground); m_view->setWindowFlags(Qt::X11BypassWindowManagerHint); @@ -213,6 +214,23 @@ void AuroraeClient::init() connect(AuroraeFactory::instance()->theme(), SIGNAL(themeChanged()), SLOT(themeChanged())); } +bool AuroraeClient::eventFilter(QObject *object, QEvent *event) +{ + // we need to filter the wheel events on the decoration + // QML does not yet provide a way to accept wheel events, this will change with Qt 5 + // TODO: remove in KDE5 + // see BUG: 304248 + if (object != widget() || event->type() != QEvent::Wheel) { + return KDecorationUnstable::eventFilter(object, event); + } + QWheelEvent *wheel = static_cast(event); + if (mousePosition(wheel->pos()) == PositionCenter) { + titlebarMouseWheelOperation(wheel->delta()); + return true; + } + return false; +} + void AuroraeClient::activeChange() { emit activeChanged(); diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index 9c20787869..b3586fd250 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -105,6 +105,7 @@ class AuroraeClient : public KDecorationUnstable public: AuroraeClient(KDecorationBridge* bridge, KDecorationFactory* factory); virtual ~AuroraeClient(); + virtual bool eventFilter(QObject *object, QEvent *event); virtual void activeChange(); virtual void borders(int& left, int& right, int& top, int& bottom) const; virtual void captionChange();