Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,437
    • Issues 1,437
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 245
    • Merge requests 245
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gtkgtk
  • Issues
  • #934

Closed
Open
Created Oct 06, 2017 by Bugzilla@bugzilla-migration💬Reporter

Focus is lost if you press tab with a single widget

Submitted by Lionel Landwerlin @djdeath

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

See also

  • Bug 773032
Assignee
Assign to
Time tracking