Menu

#2466 SCN_DWELLSTART triggered if mouse is moved outside control

Bug
closed-fixed
5
2025-04-02
2025-03-07
No

In my application, that handles dwell start/end using ScintillaEdit widget public interface, I've noticed that dwell start notification is still fired even if the mouse is moved outside scintilla control (in my case the ScintillaEdit widget).
In particular this happens only when the mouse is moved outside the scintilla widget hovering over a word that should display dwell calltip, without changing focus, and only if such word is in the last displayed line.

Example:
wrong

The image above (attached) shows the movement of the mouse I'm doing (again whithout clicking any mouse buttons nor pressing any keyboard keys).

Digging into the code, after looking #1034 (which I think is a similar case), I've found that Qt implementation never calls Editor::MouseLeave() function.
I've then tried to reimplement QWidget::leaveEvent in ScintillaEditBase class, calling inside it Editor::MouseLeave() and the issue disappeared.

This is what my ScintillaEditBase::leaveEvent looks like

void ScintillaEditBase::leaveEvent(QEvent *e)
{
    QWidget::leaveEvent(e);
    sqt->MouseLeave();
}

I'm not sure if this is the solution or would generate any other issues.

Even if I'm not sure that is relevant, please note that I'm using Qt 5.15.2 on Windows 11.
SCI_SETMOUSEDWELLTIME is set to 2 seconds.

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2025-03-08
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2025-03-08

    Committed with [e2a754].

     

    Related

    Commit: [e2a754]

  • Neil Hodgson

    Neil Hodgson - 2025-04-02
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.