commit e935613be7323c87148f6ccd93ebfc2b3911a800
Author: Koji Yokota <[email protected]>
Date: Wed Aug 19 00:04:14 2026 +0900
Reapply fix for #13318
---
src/frontends/qt/GuiWorkArea.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 0e0f194820..e122cb6f63 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -671,25 +671,26 @@ 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())
- --pos.rx();
+ --x;
else if (cur.pos() > 0) {
inset = cur.paragraph().getInset(cur.pos() - 1);
if (inset)
- ++pos.rx();
+ ++x;
}
}
if (e->reason() == QContextMenuEvent::Keyboard)
// Subtract the top margin, see #12811
- pos.setY(pos.y() - d->buffer_view_->topMargin());
+ y -= d->buffer_view_->topMargin();
- name = d->buffer_view_->contextMenu(pos.x(), pos.y());
+ name = d->buffer_view_->contextMenu(x, y);
}
if (name.empty()) {
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs