Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TextEdit mouse selection and scroll cancel #91778

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented May 9, 2024

adjust_viewport_to_caret now only cancels scrolling if it moves the viewport. Moved the scroll cancel into set_line_as_*_visible.

Made sure mouse selection stops when: right clicking, IME updates, adding caret above/below, selecting word, adding selection for next occurrence, and skip selection for occurrence.

Disabled the click_select_held timer when selection mode is shift.

@kitbdev kitbdev requested a review from a team as a code owner May 9, 2024 21:09
@YeldhamDev YeldhamDev added this to the 4.3 milestone May 10, 2024
@akien-mga akien-mga requested a review from a team May 10, 2024 08:41
@KoBeWi KoBeWi modified the milestones: 4.3, 4.4 Jul 25, 2024
@akien-mga akien-mga added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Aug 14, 2024
@kitbdev
Copy link
Contributor Author

kitbdev commented Aug 15, 2024

Rebased.

The purpose of adding set_selection_mode(SELECTION_MODE_NONE); to when the context menu opens is so that if the user is selecting text and holding down LMB and clicks RMB then text stops getting selected.
What happens is that, in multi-window mode, when the context menu popup is closed by clicking off of it, the TextEdit receives an InputEventMouseMotion with mouse flag set without a corresponding pressed InputEventMouseButton beforehand. When this happens, it continues with the last mode it was in, which is now corrected to be none.
However, The issue can still happen if a different popup was opened, like the File menu or a non TextEdit context menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code selection does not allow scrolling while moving the mouse GDScript scrolling while selecting text
4 participants