Skip to content

Commit c57bf45

Browse files
authored
Merge pull request #5549 from Textualize/fix-smooth-scroll-vscode
fix smooth scroll logic
2 parents edca00b + e5897d0 commit c57bf45

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [2.0.4] - 2025-02-17
9+
10+
### Fixed
11+
12+
- Fixed smooth scrolling breaking mouse support in VSCode (and probably others) https://github.com/Textualize/textual/pull/5549
13+
814
## [2.0.3] - 2025-02-16
915

1016
### Fixed
@@ -2735,6 +2741,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
27352741
- New handler system for messages that doesn't require inheritance
27362742
- Improved traceback handling
27372743

2744+
[2.0.4]: https://github.com/Textualize/textual/compare/v2.0.3...v2.0.4
27382745
[2.0.3]: https://github.com/Textualize/textual/compare/v2.0.2...v2.0.3
27392746
[2.0.2]: https://github.com/Textualize/textual/compare/v2.0.1...v2.0.2
27402747
[2.0.1]: https://github.com/Textualize/textual/compare/v2.0.0...v2.0.1

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "2.0.3"
3+
version = "2.0.4"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/drivers/linux_driver.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -454,19 +454,18 @@ def process_selector_events(
454454
def process_message(self, message: Message) -> None:
455455
# intercept in-band window resize
456456
if isinstance(message, TerminalSupportInBandWindowResize):
457-
# If it is supported, enabled it
458-
if message.supported and not message.enabled:
459-
self._enable_in_band_window_resize()
460-
self._in_band_window_resize = message.supported
461-
elif message.enabled:
462-
self._in_band_window_resize = message.supported
463-
self._enable_mouse_pixels()
464-
# Send up-to-date message
465-
super().process_message(
466-
TerminalSupportInBandWindowResize(
467-
message.supported, self._in_band_window_resize
468-
)
469-
)
470-
return
457+
if message.supported:
458+
self._in_band_window_resize = True
459+
if message.enabled:
460+
# Supported and enabled
461+
super().process_message(message)
462+
else:
463+
# Supported, but not enabled
464+
self._enable_in_band_window_resize()
465+
super().process_message(
466+
TerminalSupportInBandWindowResize(True, True)
467+
)
468+
self._enable_mouse_pixels()
469+
return
471470

472471
super().process_message(message)

0 commit comments

Comments
 (0)