chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.28k stars 458 forks source link

windows: Focus indicators missing with multi-threaded-message-loop #3510

Open EricPRHC opened 1 year ago

EricPRHC commented 1 year ago

[copied content from https://github.com/cefsharp/CefSharp/issues/4146]

Problem description:

When visiting some sites, An application built with CefSharp WPF does not visually indicate that a text input is focused (no text caret, no focused input border).-

This can be reproduced in the latest "CefSharp MinimalExample WPF", v102 and earlier versions such as v97.-

With "CefSharp MinimalExample WinForms" visual indicators are provided correctly, so this problem seems to exist only for the WPF version.

To Reproduce Please note that switching to another Windows application will prevent the bug from happening, see workaround. [from amaitland in referenced issue]

Interesting it does if you navigate directly to https://www.google.com/doodles or if you hide then show the window. Looks like the browser doesn't correctly think it's got focus when clicking via the mouse. Works via tabbing around, so keyboard focus appears to behave differently

Result: the code text input does not show visual focus indication such as caret and text input border, however it is possible to write into the text box.

Expected result: the text input should show a text caret and a highlight border, like it does in regular Chrome and also in "CefSharp MinimalExample WinForms"

This also occurs on other non public sites.

It appears that workarounds is available: Switch focus to another app and back again to make it work, or focus the address bar in CefSharp.MinimalExample and back again to make the focus indicating work again

Environment: OS: Windows 10 x64 CefSharp version 102 .NET 4 and core

It occurs on prior version but is reproducible with CefSharp.MinimalExample v102 from github.

Information from debug log: No relevant information found in debug log

Reproducible in CEF Sample Application: No, only for CefSharp WPF

magreenblatt commented 1 year ago

Possibly related to issue #3436