-
Notifications
You must be signed in to change notification settings - Fork 815
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
NoWidget: No widget under screen coordinate (x, y)
crash when clicking on the terminal after new screen was recently pushed
#3777
Comments
NoWidget: No widget under screen coordinate (x, y)
crash when clicking on the terminal after new screen pushedNoWidget: No widget under screen coordinate (x, y)
crash when clicking on the terminal after new screen was recently pushed
Please paste the output of |
Here you go: Traceback╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/mzebrak/.pyenv/versions/textual-tests/lib/python3.10/site-packages/textual/drivers/linux_d │
│ river.py:242 in _run_input_thread │
│ │
│ 239 │ │ an exception │
│ 240 │ │ """ │
│ 241 │ │ try: │
│ ❱ 242 │ │ │ self.run_input_thread() │
│ 243 │ │ except BaseException as error: │
│ 244 │ │ │ import rich.traceback │
│ 245 │
│ │
│ /home/mzebrak/.pyenv/versions/textual-tests/lib/python3.10/site-packages/textual/drivers/linux_d │
│ river.py:281 in run_input_thread │
│ │
│ 278 │ │ │ │ │ if mask & EVENT_READ: │
│ 279 │ │ │ │ │ │ unicode_data = decode(read(fileno, 1024)) │
│ 280 │ │ │ │ │ │ for event in feed(unicode_data): │
│ ❱ 281 │ │ │ │ │ │ │ self.process_event(event) │
│ 282 │ │ finally: │
│ 283 │ │ │ selector.close() │
│ 284 │
│ │
│ /home/mzebrak/.pyenv/versions/textual-tests/lib/python3.10/site-packages/textual/driver.py:63 in │
│ process_event │
│ │
│ 60 │ │ """ │
│ 61 │ │ event._set_sender(self._app) │
│ 62 │ │ if isinstance(event, events.MouseDown): │
│ ❱ 63 │ │ │ self._mouse_down_widget = self._app.get_widget_at(event.x, event.y)[0] │
│ 64 │ │ │ if event.button: │
│ 65 │ │ │ │ self._down_buttons.append(event.button) │
│ 66 │ │ elif isinstance(event, events.MouseUp): │
│ │
│ /home/mzebrak/.pyenv/versions/textual-tests/lib/python3.10/site-packages/textual/app.py:2606 in │
│ get_widget_at │
│ │
│ 2603 │ │ Returns: │
│ 2604 │ │ │ The widget and the widget's screen region. │
│ 2605 │ │ """ │
│ ❱ 2606 │ │ return self.screen.get_widget_at(x, y) │
│ 2607 │ │
│ 2608 │ def bell(self) -> None: │
│ 2609 │ │ """Play the console 'bell'. │
│ │
│ /home/mzebrak/.pyenv/versions/textual-tests/lib/python3.10/site-packages/textual/screen.py:289 │
│ in get_widget_at │
│ │
│ 286 │ │ Returns: │
│ 287 │ │ │ Widget and screen region. │
│ 288 │ │ """ │
│ ❱ 289 │ │ return self._compositor.get_widget_at(x, y) │
│ 290 │ │
│ 291 │ def get_widgets_at(self, x: int, y: int) -> Iterable[tuple[Widget, Region]]: │
│ 292 │ │ """Get all widgets under a given coordinate. │
│ │
│ /home/mzebrak/.pyenv/versions/textual-tests/lib/python3.10/site-packages/textual/_compositor.py: │
│ 787 in get_widget_at │
│ │
│ 784 │ │ │ for widget, cropped_region, region in self.layers_visible[y]: │
│ 785 │ │ │ │ if contains(cropped_region, x, y) and widget.visible: │
│ 786 │ │ │ │ │ return widget, region │
│ ❱ 787 │ │ raise errors.NoWidget(f"No widget under screen coordinate ({x}, {y})") │
│ 788 │ │
│ 789 │ def get_widgets_at(self, x: int, y: int) -> Iterable[tuple[Widget, Region]]: │
│ 790 │ │ """Get all widgets under a given coordinate. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
NoWidget: No widget under screen coordinate (8, 3) Textual DiagnosticsVersions
Python
Operating System
Terminal
Rich Console options
|
Will have a hotfix shortly. Didn't manage to reproduce it here, but I can see how it could occur. Would appreciate a test when it is released. |
Sure, just let me know. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Textual version: 0.43.0 (observable since 0.42.0, I haven't noticed it on 0.41.0)
Minimal working example to reproduce
Steps:
Just launch the app, then start spamming LMB on the "Click me!" Button. When you click in the right time - right after new screen was pushed - you'll get a crash.
Video
Screencast.from.11-29-2023.08.41.29.AM.webm
The text was updated successfully, but these errors were encountered: