[LyX/2.5.x] Revert "Fix #13318 (correct context menu in equations)"

Koji Yokota yokota at lyx.org
Sun Aug 16 08:04:47 UTC 2026


commit 812c1dd02cc6db2b9c578f0b74c3d38ca7a2a5ed
Author: Koji Yokota <yokota at lyx.org>
Date:   Sun Aug 16 17:03:31 2026 +0900

    Revert "Fix #13318 (correct context menu in equations)"
    
    This reverts commit 023ee18b7a7d3926a0cdbd327a7050c8317ab634.
---
 src/frontends/qt/GuiWorkArea.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index e122cb6f63..0e0f194820 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -671,26 +671,25 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
 		// the menu name is set on mouse press
 		name = d->context_menu_name_;
 	else {
+		QPoint pos = e->pos();
 		Cursor const & cur = d->buffer_view_->cursor();
-		int x, y;
-		cur.getPos(x, y);
 		if (e->reason() == QContextMenuEvent::Keyboard && cur.inTexted()) {
 			// Do not access the context menu of math right in front of before
 			// the cursor. This does not work when the cursor is in text.
 			Inset * inset = cur.paragraph().getInset(cur.pos());
 			if (inset && inset->asInsetMath())
-				--x;
+				--pos.rx();
 			else if (cur.pos() > 0) {
 				inset = cur.paragraph().getInset(cur.pos() - 1);
 				if (inset)
-					++x;
+					++pos.rx();
 			}
 		}
 		if (e->reason() == QContextMenuEvent::Keyboard)
 			// Subtract the top margin, see #12811
-			y -= d->buffer_view_->topMargin();
+			pos.setY(pos.y() - d->buffer_view_->topMargin());
 
-		name = d->buffer_view_->contextMenu(x, y);
+		name = d->buffer_view_->contextMenu(pos.x(), pos.y());
 	}
 
 	if (name.empty()) {


More information about the lyx-cvs mailing list