Focus is lost if you press tab with a single widget
@djdeath
Submitted by Lionel Landwerlin Link to original bug (#788597)
Description
Using the following example :
imports.gi.versions.Gdk = '3.0';
imports.gi.versions.Gtk = '3.0';
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
Gtk.init(null);
let win = new Gtk.Window();
win.resize(800, 800);
let ebox = new Gtk.EventBox();
ebox.set_sensitive(true);
ebox.set_can_default(true);
ebox.set_can_focus(true);
win.add(ebox);
win.show_all();
ebox.grab_focus();
ebox.connect('event', function(w, event) {
switch (event.get_event_type()) {
case Gdk.EventType.KEY_PRESS:
log('press ' + Gdk.keyval_name(event.get_keyval()[1]));
break;
case Gdk.EventType.KEY_RELEASE:
log('release ' + Gdk.keyval_name(event.get_keyval()[1]));
break;
}
log('focus :' + win.get_focus());
});
Gtk.main();
If you press Tab, you'll see that the focus gets lost every other key press. It seems pressing tab will at some point put the focus nowhere rather than going back to the first focusable widget.
Version: 3.22.x