[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.
This commit is contained in:
parent
0cc86656c9
commit
0efa9d9c73
2 changed files with 6 additions and 8 deletions
|
@ -525,14 +525,6 @@ void Client::createDecoration(const QRect& oldgeom)
|
||||||
dontMoveResize();
|
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::resizeOnlyBordersChanged, this, &Client::updateInputWindow);
|
||||||
connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this,
|
connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this,
|
||||||
[this]() {
|
[this]() {
|
||||||
|
|
|
@ -1200,7 +1200,13 @@ bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int
|
||||||
hor ? Qt::Horizontal : Qt::Vertical,
|
hor ? Qt::Horizontal : Qt::Vertical,
|
||||||
x11ToQtMouseButtons(state),
|
x11ToQtMouseButtons(state),
|
||||||
modifiers);
|
modifiers);
|
||||||
|
event.setAccepted(false);
|
||||||
QCoreApplication::sendEvent(m_decoration, &event);
|
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 {
|
} else {
|
||||||
QMouseEvent event(QEvent::MouseButtonPress, QPointF(x, y), QPointF(x_root, y_root),
|
QMouseEvent event(QEvent::MouseButtonPress, QPointF(x, y), QPointF(x_root, y_root),
|
||||||
x11ToQtMouseButton(button), x11ToQtMouseButtons(state), x11ToQtKeyboardModifiers(state));
|
x11ToQtMouseButton(button), x11ToQtMouseButtons(state), x11ToQtKeyboardModifiers(state));
|
||||||
|
|
Loading…
Reference in a new issue