[LyX/master] Tentative fix for the inset problems on Mac (#12418, maybe #12820, #12279)

Juergen Spitzmueller spitz at lyx.org
Mon Aug 21 16:05:26 UTC 2023


commit 101363352c1112335c9b4f0a456df966e4b4d755
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Aug 21 19:20:06 2023 +0200

    Tentative fix for the inset problems on Mac (#12418, maybe #12820, #12279)
    
    This is committed now in order to get testing from Mac users in the next
    prerelease. Subject to change or even reversion.
---
 src/insets/Inset.cpp |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index acd8ab2..05c6250 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -383,6 +383,22 @@ bool Inset::showInsetDialog(BufferView * bv) const
 void Inset::doDispatch(Cursor & cur, FuncRequest &cmd)
 {
 	switch (cmd.action()) {
+	// FIXME: The LFUN_MOUSE_MOTION case is a potential fix for #12418, and maybe also
+	// #12820 and #12279. This needs to be tested in the pre-release. Also it might
+	// add slight regressions with inset selection (when selection starts on the button
+	// of an inset).
+	// After this has been tested (by Mac users primarily), this comment should be
+	// updated if the fix is kept or after it has been modified.
+	case LFUN_MOUSE_MOTION:
+		// Do not attempt to select while hovering the inset button only (#12418).
+		if (!cur.selection() && cmd.button() == mouse_button::button1
+		    && clickable(cur.bv(), cmd.x(), cmd.y())) {
+			cur.noScreenUpdate();
+			cur.dispatched();
+		} else
+			cur.undispatched();
+		break;
+
 	case LFUN_MOUSE_RELEASE:
 		// if the derived inset did not explicitly handle mouse_release,
 		// we assume we request the settings dialog


More information about the lyx-cvs mailing list