python / python/cpython

Tkinter text widget scrolling uncontrollably under Wayland

Đang mở
#131,029 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

OS-linux stdlib topic-tkinter type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Bug report

Bug description:

On Gnome with Wayland (current Debian testing), resizing a Tk root window to increase the height causes a contained Text widget to scroll uncontrollably to the bottom of the widget. If the widget is scrolled while this is happening, it keeps scrolling back to the bottom.

Resizing the window again by decreasing the height or changing the width, or clicking inside the text widget, usually stops the issue.

This happens with both the mouse scrollwheel and the tkinter scrollbar.

This doesn't happen on Gnome using X, or on Windows 10. I haven't tested on any other systems.

Minimal example:


from tkinter import *
from random import choice
from string import ascii_letters

root = Tk()
textwidget = Text(root)

for i in range(1000):
    textwidget.insert(END, f'{choice(ascii_letters)} ')

textwidget.pack(fill=BOTH, expand=True)
mainloop()

A screen-recording is attached using the above code and showing the issue, which occurs the third time the window is resized.

https://github.com/user-attachments/assets/964159fa-afdf-4885-ac74-d39ae003302c

I have no idea how to debug this in more depth, any suggestions welcomed.

CPython versions tested on:

3.13

Operating systems tested on:

Linux, Windows

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp hoặc bài kiểm thử nào trong repository được nêu. Trước tiên, hãy chạy ví dụ Tkinter tối thiểu trên GNOME với Wayland, sau đó so sánh việc thay đổi kích thước và cuộn trên X theo các bước tái hiện đã được báo cáo. Được xem là hoàn tất khi việc thay đổi kích thước không còn buộc widget Text xuống cuối hoặc ghi đè thao tác cuộn của người dùng trên Wayland.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
desktop
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.