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

Address Bar and Browser Focus Issue #52

Open
cretz opened this issue Sep 19, 2017 · 5 comments
Open

Address Bar and Browser Focus Issue #52

cretz opened this issue Sep 19, 2017 · 5 comments

Comments

@cretz
Copy link
Owner

cretz commented Sep 19, 2017

Go to a link, click something (to make navigation history). Then, click off the address bar and into the browser, then back into the address bar and press backspace and watch the nav go back.

We need to solve this as a focus issue. the address bar obtaining focus is not removing focus from the browser. There are other ways of triggering this such as entering a text area in the browser, going back to the URL, going back to the text area, and seeing URL still retain a cursor.

@cretz
Copy link
Owner Author

cretz commented Sep 20, 2017

Added small commit to set a strong policy which includes click of CEF widget focus. But we still have a problem (as mentioned in #51) where the address bar on a new window looks like it has focus and even has a cursor, but key events are not sent to it when typed.

@dwarfcrank
Copy link
Contributor

I think I found a way to reliably reproduce this issue, at least the part related to #51. I've tested these steps on Arch Linux with the i3 window manager (with focus-follows-mouse both on and off, as I originally thought it might have something to do with this).

Qt version is 5.9.1 and CEF binary distribution is 3.3163.1666.g052c2d2.

  1. Make sure the mouse cursor is hovering over the CEF widget, not any other part of the UI.
  2. Open a new page.
  3. Without moving the mouse, type something. Nothing should appear in the address bar, even though it seems to have focus.
  4. Move the mouse off the CEF widget without clicking anything and type something. Keyboard events should work again. Likewise, when moving the mouse back to the CEF widget, keyboard events won't be sent to the URL bar anymore.

@cretz
Copy link
Owner Author

cretz commented Sep 22, 2017

Thanks! I'll work to replicate and see if I can solve when I get some time.

@dwarfcrank
Copy link
Contributor

I looked some more into this and noticed that key events aren't sent at all if the CEF widget doesn't have any document loaded (which is the case with a new tab).

As a hacky test, I made BrowserStack::NewBrowser load a data URI if the given URL is empty, and it seems to work (see the commit). Though in this case the browser will also have focus in addition to the URL bar.

@cretz
Copy link
Owner Author

cretz commented Sep 23, 2017

Thanks. The reason I haven't peeked yet is that i regularly use Doogie on Windows and my focus issues are different and aren't replicated in the same way.

cretz added a commit that referenced this issue Oct 2, 2017
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

2 participants