From 0efa9d9c730acb0ae163a0d2933468e9e4d0d57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 28 Nov 2014 14:08:13 +0100 Subject: [PATCH] [kdecoration2] Decoration does not provide titleBarWheelEvent any more Instead KWin needs to determine by itself whether it should act on the wheel event. The Decoration will set it to accepted if it handled it. --- client.cpp | 8 -------- events.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client.cpp b/client.cpp index 23900e2653..266116eeb6 100644 --- a/client.cpp +++ b/client.cpp @@ -525,14 +525,6 @@ void Client::createDecoration(const QRect& oldgeom) dontMoveResize(); } ); - connect(m_decoration, &KDecoration2::Decoration::titleBarWheelEvent, this, - [this](const QPoint &angleDelta) { - if (angleDelta.y() == 0) { - return; - } - performMouseCommand(options->operationTitlebarMouseWheel(angleDelta.y()), Cursor::pos()); - } - ); connect(m_decoration, &KDecoration2::Decoration::resizeOnlyBordersChanged, this, &Client::updateInputWindow); connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { diff --git a/events.cpp b/events.cpp index 24794d87a2..eac8f73d92 100644 --- a/events.cpp +++ b/events.cpp @@ -1200,7 +1200,13 @@ bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int hor ? Qt::Horizontal : Qt::Vertical, x11ToQtMouseButtons(state), modifiers); + event.setAccepted(false); QCoreApplication::sendEvent(m_decoration, &event); + if (!event.isAccepted() && !hor) { + if (m_decoration->titleBar().contains(x, y)) { + performMouseCommand(options->operationTitlebarMouseWheel(delta), QPoint(x_root, y_root)); + } + } } else { QMouseEvent event(QEvent::MouseButtonPress, QPointF(x, y), QPointF(x_root, y_root), x11ToQtMouseButton(button), x11ToQtMouseButtons(state), x11ToQtKeyboardModifiers(state));