python / python/cpython

Tkinter text widget scrolling uncontrollably under Wayland

Abierto
#131,029 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

OS-linux stdlib topic-tkinter type-bug
Lenguaje dominante
Python
Estrellas
77.2k
Forks
36k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

No se indica ningún archivo ni prueba del repositorio. Empieza ejecutando el ejemplo mínimo de Tkinter en GNOME con Wayland y, después, compara el redimensionamiento y el desplazamiento bajo X siguiendo los pasos de reproducción indicados. Se considera terminado cuando el redimensionamiento ya no fuerza el widget Text hasta la parte inferior ni anula el desplazamiento del usuario en Wayland.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
desktop
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.