File 0039-AppMenu-Applet-Map-from-scene-after-mapping-from-glo.patch of Package plasma5-workspace
From 6752604fd6d53e489b36bdc14e25939081fec278 Mon Sep 17 00:00:00 2001
From: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Mon, 6 Feb 2017 11:15:07 +0100
Subject: [PATCH 39/44] [AppMenu Applet] Map from scene after mapping from
global
childAt expects coordinates relative to the item, so we need to mapFromScene before we do that.
BUG: 375535
FIXED-IN: 5.9.1
Differential Revision: https://phabricator.kde.org/D4452
---
applets/appmenu/lib/appmenuapplet.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/applets/appmenu/lib/appmenuapplet.cpp b/applets/appmenu/lib/appmenuapplet.cpp
index cbdd2589..9aaf5cc6 100644
--- a/applets/appmenu/lib/appmenuapplet.cpp
+++ b/applets/appmenu/lib/appmenuapplet.cpp
@@ -234,8 +234,9 @@ bool AppMenuApplet::eventFilter(QObject *watched, QEvent *event)
}
// FIXME the panel margin breaks Fitt's law :(
- const QPointF &localPos = m_buttonGrid->window()->mapFromGlobal(e->globalPos());
- auto *item = m_buttonGrid->childAt(localPos.x(), localPos.y());
+ const QPointF &windowLocalPos = m_buttonGrid->window()->mapFromGlobal(e->globalPos());
+ const QPointF &buttonGridLocalPos = m_buttonGrid->mapFromScene(windowLocalPos);
+ auto *item = m_buttonGrid->childAt(buttonGridLocalPos.x(), buttonGridLocalPos.y());
if (!item) {
return false;
}
--
2.12.0