Setting GtkEntry insensitive from its `activate` handler produces a warning.
Here's a minimal example in Vala to reproduce the issue:
#!/usr/bin/env -S vala --pkg gtk4
int main() {
Gtk.init();
var loop = new MainLoop();
var window = new Gtk.Window();
var entry = new Gtk.Entry();
entry.activate.connect(() => {
entry.sensitive = false; //< Issue
});
window.close_request.connect(() => {
loop.quit();
return false;
});
window.child = entry;
window.present();
loop.run();
return 0;
}
This opens a window with an input field. Pressing Enter makes field inactive (as expected) and produces the following warning:
(process:99550): Gtk-WARNING **: 21:32:47.623: GtkText - did not receive a focus-out event.
If you handle this event, you must return
GDK_EVENT_PROPAGATE so the default handler
gets the event as well
Libadwaita's AdwEntryRow and its descendants exhibit this problem as well. I've discovered this during migration from Gtk3 where this worked without warnings.