Append "pointer" to AbstractClient::{enterEvent,leaveEvent}

KWin handles several types of pointing input devices, e.g. mice,
tablets, etc.

As is, enterEvent and leaveEvent are very ambiguous. This change
prepends "pointer" to those methods to make it explicit that they handle
pointer enter/leave events.
This commit is contained in:
Vlad Zahorodnii 2021-11-29 18:59:06 +02:00
parent a93d24f4b0
commit d3342c6897
5 changed files with 11 additions and 11 deletions

View file

@ -2516,7 +2516,7 @@ void AbstractClient::setDecoratedClient(QPointer< Decoration::DecoratedClientImp
m_decoration.client = client;
}
void AbstractClient::enterEvent(const QPoint &globalPos)
void AbstractClient::pointerEnterEvent(const QPoint &globalPos)
{
if (options->isShadeHover()) {
cancelShadeHoverTimer();
@ -2544,7 +2544,7 @@ void AbstractClient::enterEvent(const QPoint &globalPos)
}
}
void AbstractClient::leaveEvent()
void AbstractClient::pointerLeaveEvent()
{
cancelAutoRaise();
workspace()->cancelDelayFocus();

View file

@ -598,8 +598,8 @@ public:
void endInteractiveMoveResize();
void keyPressEvent(uint key_code);
void enterEvent(const QPoint &globalPos);
void leaveEvent();
void pointerEnterEvent(const QPoint &globalPos);
void pointerLeaveEvent();
/**
* These values represent positions inside an area

View file

@ -679,7 +679,7 @@ void X11Client::enterNotifyEvent(xcb_enter_notify_event_t *e)
if (e->mode == XCB_NOTIFY_MODE_NORMAL || (e->mode == XCB_NOTIFY_MODE_UNGRAB && MOUSE_DRIVEN_FOCUS)) {
#undef MOUSE_DRIVEN_FOCUS
enterEvent(QPoint(e->root_x, e->root_y));
pointerEnterEvent(QPoint(e->root_x, e->root_y));
return;
}
}
@ -712,7 +712,7 @@ void X11Client::leaveNotifyEvent(xcb_leave_notify_event_t *e)
}
}
if (lostMouse) {
leaveEvent();
pointerLeaveEvent();
if (isDecorated()) {
// sending a move instead of a leave. With leave we need to send proper coords, with move it's handled internally
QHoverEvent leaveEvent(QEvent::HoverMove, QPointF(-1, -1), QPointF(-1, -1), Qt::NoModifier);

View file

@ -198,7 +198,7 @@ void PointerInputRedirection::updateToReset()
}
if (focus()) {
if (AbstractClient *c = qobject_cast<AbstractClient*>(focus())) {
c->leaveEvent();
c->pointerLeaveEvent();
}
disconnect(m_focusGeometryConnection);
m_focusGeometryConnection = QMetaObject::Connection();
@ -568,7 +568,7 @@ static bool s_cursorUpdateBlocking = false;
void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow)
{
if (AbstractClient *ac = qobject_cast<AbstractClient*>(focusOld)) {
ac->leaveEvent();
ac->pointerLeaveEvent();
breakPointerConstraints(ac->surface());
disconnectPointerConstraintsConnection();
}
@ -576,7 +576,7 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow
m_focusGeometryConnection = QMetaObject::Connection();
if (AbstractClient *ac = qobject_cast<AbstractClient*>(focusNow)) {
ac->enterEvent(m_pos.toPoint());
ac->pointerEnterEvent(m_pos.toPoint());
}
if (internalWindow()) {

View file

@ -85,13 +85,13 @@ void TouchInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow)
// TODO: handle pointer grab aka popups
if (AbstractClient *ac = qobject_cast<AbstractClient*>(focusOld)) {
ac->leaveEvent();
ac->pointerLeaveEvent();
}
disconnect(m_focusGeometryConnection);
m_focusGeometryConnection = QMetaObject::Connection();
if (AbstractClient *ac = qobject_cast<AbstractClient*>(focusNow)) {
ac->enterEvent(m_lastPosition.toPoint());
ac->pointerEnterEvent(m_lastPosition.toPoint());
workspace()->updateFocusMousePosition(m_lastPosition.toPoint());
}