From 0b955611938716ae907a0972c23288c1e977ad25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 31 Aug 2015 10:28:03 +0200 Subject: [PATCH] Fake a leave event for the decoration when client is left We need to send a fake HoverMove event on minimized to remove all hovered states of the decoration. At the same time we need to ensure that no further hover events are sent to a minimized client. BUG: 351984 FIXED-IN: 5.4.1 REVIEW: 124997 --- events.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/events.cpp b/events.cpp index 3ce3f917c9..5baab1fb1a 100644 --- a/events.cpp +++ b/events.cpp @@ -1006,6 +1006,11 @@ void Client::leaveNotifyEvent(xcb_leave_notify_event_t *e) shadeHoverTimer->setSingleShot(true); shadeHoverTimer->start(options->shadeHoverInterval()); } + if (m_decoration) { + // 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); + QCoreApplication::sendEvent(m_decoration, &leaveEvent); + } } if (options->focusPolicy() == Options::FocusStrictlyUnderMouse && isActive() && lostMouse) { workspace()->requestDelayFocus(0); @@ -1343,7 +1348,7 @@ void Client::checkQuickTilingMaximizationZones(int xroot, int yroot) // return value matters only when filtering events before decoration gets them bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_root, int y_root) { - if (w == frameId() && m_decoration) { + if (w == frameId() && m_decoration && !isMinimized()) { // TODO Mouse move event dependent on state QHoverEvent event(QEvent::HoverMove, QPointF(x, y), QPointF(x, y)); QCoreApplication::instance()->sendEvent(m_decoration, &event);