From 3da9c45df245a004556f990720e3928e10857f7b Mon Sep 17 00:00:00 2001
From: Nicolas Werner <nicolas.werner@hotmail.de>
Date: Sun, 7 Mar 2021 18:23:50 +0100
Subject: [PATCH] Fix popup opening at wrong place

fixes #512
---
 resources/qml/TimelineRow.qml  | 4 ++--
 resources/qml/TimelineView.qml | 7 ++-----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index ace7fc87a..0f815f6fa 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -28,11 +28,11 @@ Item {
 
     TapHandler {
         acceptedButtons: Qt.RightButton
-        onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row, mapToItem(timelineRoot, eventPoint.position.x, eventPoint.position.y))
+        onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row)
     }
 
     TapHandler {
-        onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row, mapToItem(timelineRoot, point.position.x, point.position.y))
+        onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row)
         onDoubleTapped: chat.model.reply = model.id
     }
 
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 905926c46..0a8233293 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -80,15 +80,12 @@ Page {
         property bool isEncrypted
         property bool isEditable
 
-        function show(eventId_, eventType_, isEncrypted_, isEditable_, showAt_, position) {
+        function show(eventId_, eventType_, isEncrypted_, isEditable_, showAt_) {
             eventId = eventId_;
             eventType = eventType_;
             isEncrypted = isEncrypted_;
             isEditable = isEditable_;
-            if (position)
-                popup(position, showAt_);
-            else
-                popup(showAt_);
+            popup(showAt_);
         }
 
         modal: true
-- 
GitLab