Skip to content

Mouse release event is lost if the pane becomes inactive #3251

@dmaluka

Description

@dmaluka

Micro delivers mouse events, including mouse release events, to the currently active pane or tab only. As a result, in the following scenario:

  1. press a mouse button on an active pane or tab
  2. switch to another pane or tab (or, for example, switch to the infopane, e.g. begin typing a command), while keeping the mouse button pressed
  3. release the mouse button

the mouse release event is delivered to the new active pane, not to the original one. As a result, when we switch again to the original pane, it thinks that the mouse is still pressed, and thus handles mouse events incorrectly.

Some examples of issues caused by this bug:

  1. If the file opened in the bufpane has been modified by another program and then we click on the bufpane with the mouse, micro shows The file on disk has changed. Reload file? (y,n,esc) prompt. And then, after pressing y in this prompt, scrolling via the mouse wheel stops working. It starts working again only after clicking a mouse button once again. (In this case, the issue occurs because the prompt switches the focus from the bufpane to the infopane immediately after the mouse is pressed, before it is released.)

  2. Press a mouse button, switch to another split pane via Ctrl-w (without releasing the mouse), release the mouse and switch back to the original pane. Then click mouse somewhere in that pane. Result: unexpected text selection.

  3. Begin resizing a split pane by dragging the split pane divider with the mouse, switch to another tab via Alt-. (without releasing the mouse), release the mouse and switch back to the original tab. Then click mouse somewhere. Result: unexpected resize of the split pane.

Commit hash: f386b29
OS: any
Terminal: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions