Menu

#2443 Sometimes caret flickers

Bug
closed-fixed
nobody
5
2024-07-22
2024-06-25
Gintaras Q
No

In SciTE and other apps using Scintilla, sometimes the mouse pointer flickers when moving over app parts other than Scintilla. Tested on Windows, all versions. Tested with the newest SciTE.

Previously, to fix it I used to restart the app. Now I discovered that stops flickering when clicked in Scintilla again.

To reproduce: press the left mouse button; drag to select some text; right-click; release the left mouse button. It shows a context menu. While the context menu is visible, the caret is I beam instead of arrow. After closing it, caret flickers (switches between arrow etc and I beam) when moving over other parts of the window.

Maybe Scintilla does not handle WM_CAPTURECHANGED.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2024-07-05
    • labels: --> scintilla, mouse, win32
     
  • Neil Hodgson

    Neil Hodgson - 2024-07-05

    This is caused by the automatic scrolling code that triggers on a timer that is started on mouse down and cancelled on mouse up. It wasn't being cancelled when capture changed for other reasons. This patch may fix it:

    --- a/src/Editor.cxx    Wed Jul 03 09:44:24 2024 +1000
    +++ b/src/Editor.cxx    Fri Jul 05 10:18:39 2024 +1000
    @@ -5186,7 +5186,12 @@
                break;
            case TickReason::scroll:
                // Auto scroll
    
    -           ButtonMoveWithModifiers(ptMouseLast, 0, KeyMod::Norm);
    +           if (HaveMouseCapture()) {
    +               ButtonMoveWithModifiers(ptMouseLast, 0, KeyMod::Norm);
    +           } else {
    +               // Capture cancelled so cancel timer
    +               FineTickerCancel(TickReason::scroll);
    +           }
                break;
            case TickReason::widen:
                SetScrollBars();
    
     
  • Neil Hodgson

    Neil Hodgson - 2024-07-09
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2024-07-09

    Committed fix as [e9035c].

     

    Related

    Commit: [e9035c]

  • Neil Hodgson

    Neil Hodgson - 2024-07-22
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB