Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple keyboard focus issues on Linux/Mac #284

Open
cztomczak opened this issue Dec 15, 2016 · 2 comments
Open

Multiple keyboard focus issues on Linux/Mac #284

cztomczak opened this issue Dec 15, 2016 · 2 comments

Comments

@cztomczak
Copy link
Owner

cztomczak commented Dec 15, 2016

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.

cztomczak added a commit that referenced this issue Dec 20, 2016
…AK!).

Fix focus issue in qt.py and gtk2.py examples during app initial
loading (#284). The solution is to call SetFocus in OnLoadStart once.

Pass keyword arguments to Handlers' callbacks (#291). This will break
many of existing code for Handlers' callbacks. Similar changes were also
applied to: CookieVisitor, StringVisitor, WebRequestClient.

In JavascriptDialogCallback.Continue "userInput" argument was renamed
to "user_input".

Fix PyCharm warnings in kivy_.py example (#285).

Rename JavascriptContextHandler to V8ContextHandler (API docs only
changes).

Update tools/apidocs.py. Sort top-level headings by name.
@cztomczak cztomczak added this to the v55 milestone Feb 24, 2017
@cztomczak cztomczak changed the title Multiple keyboard focus issues on Linux Multiple keyboard focus issues on Linux/Mac Mar 3, 2017
@cztomczak
Copy link
Owner Author

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

@cztomczak
Copy link
Owner Author

cztomczak commented Nov 14, 2018

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
Projects
None yet
Development

No branches or pull requests

1 participant