GtkColumnView - clicking on empty space around cell cause freeze/crash

I’ve got a columnview and each cell has things like entry, spinbutton, splitbutton etc.

I’ve realised if I click on a tiny bit of empty space around each cell widget the whole app freezes. I have to wait for a box to pop up asking if I want to wait or force quit. Even ctrl-c from the terminal doesn’t close it instantly.

If I disable can-focus and can-target on the columnview it doesn’t crash but then, of course, I can’t enter data.

I wonder how I might stop this? I suppose if the widget filled each cell completely it might stop it from happening but I’m not too sure how to do this either! Besides, I like the rounded corners.

Only the columnview has a ‘card’ css-class but removing that still presents the tiny empty space.

Thank you for any help

Because I got bored of chasing my tail I decided to take my Python files and build them Flatpak and it solved the problem.

Please always specify distro, gtk version.

IIUC, it’s a hang and not a crash. If it’s indeed a crash, getting a stack trace should help.

Also, can you post a minimal code which reproduces the issue?

gtk-issue#7208 sounds related, but it’s a SIGSEGV crash.

Thank you for replying.

It’s openSUSE Tumbleweed, gtk 4.16 PyGObject 3.48 and Python 3.11.

You’re right, it’s not a crash. gdb only shows something else.

Here is what I have, stripped down to one column. (The colours disappear as soon as I add something under ‘entry = Gtk.Entry()’, ?). I’d have to upload the whole lot to github for it to be reproducible.

# contact
def connect_signals(self, contact_row):
    self.contact_home.new_invoice_button.connect("clicked", self.scroll_to_invoice_composer, contact_row)

def scroll_to_invoice_composer(self, widget, contact_row):
    self.contact_invoice_composer.blank_invoice_row()
# contact_invoice_composer
class InvoiceRowDataObject(GObject.Object):
    __gtype_name__ = 'InvoiceRowDataObject'     
    
    def __init__(self, desciption):
        super().__init__()
        
        self._description    = description
    
    @GObject.Property(type=str)
    def description(self):
        return self._description
    
    @description.setter
    def set_description(self, description):
        if self._description != description:
            self._description = description
            self.notify("description")

@Gtk.Template(filename='invoice_composer.ui')
class InvoiceComposer(Gtk.Box):
    __gtype_name__ = "InvoiceComposer"
    
    new_invoice_liststore       = Gtk.Template.Child()

    def __init__(self):
        super().__init__()

    def setup_invoice_composer(self, contact_row, account_type):
        
        def factory_setup_entry(factory, item):
            entry = Gtk.Entry()
            entry.set_editable(True)
            item.set_child(entry)
            entry.connect('activate', self.blank_invoice_row)
        
        def description_factory_bind(factory, item):
            item.get_item().bind_property("description", item.get_child(), "text", GObject.BindingFlags.BIDIRECTIONAL)
            item.get_child().set_text(item.get_item().description)
        
        def blank_invoice_row(self, *args):
            self.new_invoice_liststore.append(InvoiceRowDataObject(""))
        
        self.description_factory.connect("setup", factory_setup_entry)
        self.description_factory.connect("bind", description_factory_bind)

Not sure it could be related but found some strange issue in another method.
Just interesting, have you implemented setup method in the model factory?