GtkListBox crashes if the placeholder is focused and then TAB is pressed
Steps to reproduce
- Create a
GtkListBox
. - Add a button as placeholder to it.
- Click the button.
- Press
TAB
. - The program crashes.
Example
Though the example is in Python, it happens irrespective of the language.
"""
Steps to reproduce:
1. Run the file: python3 crash.py
2. Click "Crash Me"
3. Press TAB
"""
import gi
# Replace with 3.0 for Gtk 3 and 4.0 for Gtk 4
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
def on_activate(app):
lbox = Gtk.ListBox(visible=True)
lbox.set_placeholder(Gtk.Button(label="Crash Me", visible=True))
win = Gtk.ApplicationWindow(application=app)
win.add(lbox) # For Gtk 3
# win.set_child(lbox) # For Gtk 4
win.present()
app = Gtk.Application(application_id="com.example.example")
app.connect("activate", on_activate)
app.run([])
Version information
OS: Debian GNU/Linux trixie/sid
Gtk 3: 3.24.40-2
Gtk 4: 4.12.5+ds-2
Warnings
/usr/lib/python3/dist-packages/gi/overrides/Gio.py:42: Warning: g_sequence_iter_is_end: assertion 'iter != NULL' failed
return Gio.Application.run(self, *args, **kwargs)
/usr/lib/python3/dist-packages/gi/overrides/Gio.py:42: Warning: g_sequence_get: assertion 'iter != NULL' failed
return Gio.Application.run(self, *args, **kwargs)
(main.py:26201): Gtk-CRITICAL **: 20:26:56.762: gtk_widget_get_sensitive: assertion 'GTK_IS_WIDGET (widget)' failed
/usr/lib/python3/dist-packages/gi/overrides/Gio.py:42: Warning: g_sequence_iter_next: assertion 'iter != NULL' failed
return Gio.Application.run(self, *args, **kwargs)
fish: Job 1, 'python3 crash.py' terminated by signal SIGSEGV (Address boundary error)
Backtrace
CC: @guidog
Edited by Arun Mani J