File 0021-Avoid-using-API-new-in-Qt-5.7.-Plasma-workspace-reli.patch of Package plasma5-workspace
From 6bcd25c5ded0eace7beb909b79d177bf50664a64 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Thu, 12 Jan 2017 11:59:54 +0000
Subject: [PATCH 21/44] Avoid using API new in Qt 5.7. Plasma-workspace relies
on Qt5.6
Test Plan: Tested menu is still in the same place
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4099
---
applets/appmenu/lib/appmenuapplet.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/applets/appmenu/lib/appmenuapplet.cpp b/applets/appmenu/lib/appmenuapplet.cpp
index 51fd3a6c..7c053e6f 100644
--- a/applets/appmenu/lib/appmenuapplet.cpp
+++ b/applets/appmenu/lib/appmenuapplet.cpp
@@ -165,7 +165,7 @@ void AppMenuApplet::trigger(QQuickItem *ctx, int idx)
const auto &geo = ctx->window()->screen()->availableVirtualGeometry();
- QPoint pos = ctx->mapToGlobal(QPointF(0, 0)).toPoint();
+ QPoint pos = ctx->window()->mapToGlobal(ctx->position().toPoint());
if (location() == Plasma::Types::TopEdge) {
pos.setY(pos.y() + ctx->height());
}
@@ -233,7 +233,7 @@ bool AppMenuApplet::eventFilter(QObject *watched, QEvent *event)
}
// FIXME the panel margin breaks Fitt's law :(
- const QPointF &localPos = m_buttonGrid->mapFromGlobal(e->globalPos());
+ const QPointF &localPos = m_buttonGrid->window()->mapFromGlobal(e->globalPos());
auto *item = m_buttonGrid->childAt(localPos.x(), localPos.y());
if (!item) {
return false;
--
2.12.0