From 3dbfa6a32545c9afd27bf8c1e86cba516b71d2a6 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 12 Feb 2020 10:03:39 +0200 Subject: [PATCH] Return early if close button accepts input event Summary: Otherwise we close the effect whenever the close is pressed which is a behavioural change. That in turn leads to bigger bugs BUG: 415155 Test Plan: Ran effect Clicked on the "Whitespace" of the dash Clicked on the close Now matches desktopgrid code Reviewers: #kwin, zzag, ngraham Reviewed By: #kwin, zzag, ngraham Subscribers: ngraham, zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D27333 --- effects/presentwindows/presentwindows.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index a6161d45b3..ee1e526aa7 100644 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -538,6 +538,7 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) if (!me) { return; } + me->setAccepted(false); if (m_closeView) { const bool contains = m_closeView->geometry().contains(me->pos()); if (!m_closeView->isVisible() && contains) { @@ -545,6 +546,9 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) } m_closeView->forwardMouseEvent(e); } + if (e->isAccepted()) { + return; + } inputEventUpdate(me->pos(), me->type(), me->button()); }