[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.
icc-effect-5.14.5
Martin Gräßlin 2014-11-28 14:08:13 +01:00
parent 0cc86656c9
commit 0efa9d9c73
2 changed files with 6 additions and 8 deletions

View File

@ -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]() {

View File

@ -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));