[LyX/master] Fix inset context menu offset with keyboard (#12811)

Juergen Spitzmueller spitz at lyx.org
Mon Jul 3 13:17:17 UTC 2023


commit d5a96997942a4d2040db848be6b22eae78675057
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Jul 3 16:28:38 2023 +0200

    Fix inset context menu offset with keyboard (#12811)
---
 src/frontends/qt/GuiWorkArea.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 87181f9..7433c28 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -652,6 +652,10 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
 					++pos.rx();
 			}
 		}
+		if (e->reason() == QContextMenuEvent::Keyboard)
+			// Subtract the top margin
+			pos.setY(pos.y() - d->buffer_view_->topMargin());
+
 		name = d->buffer_view_->contextMenu(pos.x(), pos.y());
 	}
 


More information about the lyx-cvs mailing list