Skip to content

MouseMove events bubble up and are posted by Screen#2987

Merged
rodrigogiraoserrao merged 3 commits intoTextualize:mainfrom
seifertm:2905-send-mouse-move-events-to-screen
Aug 8, 2023
Merged

MouseMove events bubble up and are posted by Screen#2987
rodrigogiraoserrao merged 3 commits intoTextualize:mainfrom
seifertm:2905-send-mouse-move-events-to-screen

Conversation

@seifertm
Copy link
Copy Markdown
Contributor

@seifertm seifertm commented Jul 22, 2023

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

This PR changes the behavior of MouseMove events to bubble up from Widgets. Screen receives the MouseMove event when there's no other Widget in the App.

Note: The relative coordinates of the MouseMove events do not change when bubbling up, i.e. they always stay relative to the Widget that received the event. This behavior is consistent with other mouse events such as Click.

There's some more room for refactoring as the handling of MouseMove and MouseEvent in Screen._forward_event is almost the same. The main difference seems to be that MouseEvent sets or resets the focused widget, whereas MouseMove sets or resets the mouse over.

Closes #2905

… widget.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Copy link
Copy Markdown
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

We may prefer the changelog message in the "Changed" section, though.

@rodrigogiraoserrao
Copy link
Copy Markdown
Contributor

@willmcgugan review away.

Copy link
Copy Markdown
Member

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@rodrigogiraoserrao rodrigogiraoserrao merged commit be2ec1d into Textualize:main Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send mouse move events to screen

3 participants