commit 3674eede7412e4982508eb8287288f6ff7630abc
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Fri Dec 5 12:27:09 2025 +0100

    Fixup 9fd397ac: fix handling of mouseSetCursor()'s return value
    
    Since the default value has changed, the logic needs to change too.
    
    This will create an extra full metrics update in the case where
    checkDepm, but this is (unfortunately) consistent with other used of
    checkDepm. Therefore, it is better to do it like that for now.
---
 src/BufferView.cpp | 1 +
 src/Text.cpp       | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index e183d92b62..97ca1a5581 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -3183,6 +3183,7 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old)
 
        // we would rather not do this here, but it needs to be done before
        // the changed() signal is sent.
+       // FIXME : code using checkDepm will trigger a second full metrics 
update.
        buffer_.updateBuffer();
 
        buffer_.changed(true);
diff --git a/src/Text.cpp b/src/Text.cpp
index 20adeeab2a..08b5a516e9 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -5276,8 +5276,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        if (!bvcur.selection())
                                // Set the cursor
                                bvcur.resetAnchor();
-                       if (!bv->mouseSetCursor(cur, cmd.modifier() == 
ShiftModifier))
-                               cur.screenUpdateFlags(Update::FitCursor);
+                       needsUpdate |= bv->mouseSetCursor(cur, cmd.modifier() 
== ShiftModifier);
                        // FIXME: move this to mouseSetCursor?
                        if (bvcur.wordSelection() && bvcur.inTexted())
                                expandWordSel(bvcur);
@@ -5302,8 +5301,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                cur.noScreenUpdate();
                                return;
                        }
-                       if (!bv->mouseSetCursor(cur, false))
-                               cur.screenUpdateFlags(Update::FitCursor);
+                       needsUpdate |= bv->mouseSetCursor(cur, false));
                        break;
                }
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to