From c6e6d9a8723ab3f5da3c63d88ee3f2d3770b7967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 18 Feb 2016 13:00:50 +0100 Subject: [PATCH] Move leaveNotify event handling to AbstractClient Only most basic to cancel auto raise and delayed focus. --- abstract_client.cpp | 9 +++++++++ abstract_client.h | 1 + events.cpp | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index 1d233c7bbb..8820e6d0fe 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -1523,4 +1523,13 @@ void AbstractClient::enterEvent(const QPoint &globalPos) } } +void AbstractClient::leaveEvent() +{ + cancelAutoRaise(); + workspace()->cancelDelayFocus(); + // TODO: shade hover + // TODO: send hover leave to deco + // TODO: handle Options::FocusStrictlyUnderMouse +} + } diff --git a/abstract_client.h b/abstract_client.h index fe88ed2870..fff6febf01 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -407,6 +407,7 @@ public: void keyPressEvent(uint key_code); void enterEvent(const QPoint &globalPos); + void leaveEvent(); /** * These values represent positions inside an area diff --git a/events.cpp b/events.cpp index 3cc0afd17c..61462abbe9 100644 --- a/events.cpp +++ b/events.cpp @@ -978,8 +978,7 @@ void Client::leaveNotifyEvent(xcb_leave_notify_event_t *e) } } if (lostMouse) { - cancelAutoRaise(); - workspace()->cancelDelayFocus(); + leaveEvent(); cancelShadeHoverTimer(); if (shade_mode == ShadeHover && !isMoveResize() && !isMoveResizePointerButtonDown()) { shadeHoverTimer = new QTimer(this);