Tkinter text widget scrolling uncontrollably under Wayland
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
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
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
未指定 repository 中的檔案或測試。首先在使用 Wayland 的 GNOME 上執行最小 Tkinter 範例,然後按照回報的重現步驟比較 X 下的調整大小和捲動行為。完成的標準是:在 Wayland 上,調整大小不再強制 Text widget 捲動到底部,也不再覆寫使用者的捲動操作。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- desktop
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100