Skip to content

Multiple keyboard focus issues on Linux/Mac #284

Open

Description

@cztomczak

Update: Focus issues also occur on Mac. CEF browser is always stealing focus when switching between navigation bar and cef widget controls.

There are multiple keyboard focus issues reproducible in many examples. This is an upstream CEF issue, reported problems in great details in CEF Issue #2026.

All focus issues were fixed with workarounds. There are mostly two types of fixes that helped. In some examples only one of them was needed, in others it was required to apply both fixes.

  1. Call Browser.SetFocus during initial app loading in LoadHandler.OnLoadStart
  2. Call Browser.SetFocus in FocusHandler.OnGotFocus. If this is not applied then when switching to another window (alt+tab) and then back to this example, keyboard focus becomes broken, you can't type anything, even though a type cursor blinks in web view.
  3. In tkinter example there is yet another special fix to restore focus by calling focus_force() on the top control

CEF Issue #1856 may be related.

Keeping this issue still Open until this is properly fixed in upstream CEF.

Activity

  1. added this to the v55 milestone on Feb 24, 2017
  2. changed the title [-]Multiple keyboard focus issues on Linux[/-] [+]Multiple keyboard focus issues on Linux/Mac[/+] on Mar 3, 2017
  3. cztomczak commented on Nov 14, 2018

    @cztomczak
    OwnerAuthor

    Focus issues can be resolved on Linux by applying a few patches to CEF, see this comment:
    https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on#comment-42770322

  4. cztomczak commented on Nov 14, 2018

    @cztomczak
    OwnerAuthor

    See also this comment that shows how to resolve the issue by making calls to Browser.SendFocusEvent in grab_focus, focus_in_event and focus_out_event GTK events: tiliado/cef@b1d9e48#commitcomment-27005338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions