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

Windows virtual keyboard doesn't show up after user presses X button to close the keyboard #3662

Open
cassandras00 opened this issue Mar 7, 2024 · 7 comments
Labels
alloy Related to the Alloy runtime bug Bug report help wanted Issue resolution will likely require community contributions needs user feedback Additional feedback required windows Windows platform

Comments

@cassandras00
Copy link

cassandras00 commented Mar 7, 2024

Describe the bug
We have a windows forms application (using CefSharp) that is running on a windows tablet with touchscreen. When a user input is focused and the virtual keyboard is used, it shows. Then if you press X to close it, and tap the input (or any other input field) again, it doesn't show up. You have to click somewhere else on the application to lose the focus (which is still there, but not visible).

To Reproduce
Steps to reproduce the behavior:

  1. Use a windows forms application with the newest cefSharp Version
  2. Click on a user input
  3. Close the virtual keyboard using the X button
  4. Click on any user input
  5. The keyboard won't show

Expected behavior
After closing the keyboard with X button clicking on a user input should show it again.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: Windows 10
  • CEF Version: 121.3.13

Additional context
Does the problem reproduce with the cefclient or cefsimple sample application at the same version?

Does the problem reproduce with Google Chrome at the same version?
In the browser (tested in chrome and edge) the issue does not occur.

Add any other context about the problem here.
This bug was also in WebView2, here is the link to the issue (you have to scroll down, there is a comment and fix as to why the issue occurs.
Copied the important part:
CEF does not receive the COM event notification when the OSK is closed. The keyboard controller class "VirtualKeyboardControllerWin" tracks the visibility state with the data member "virtual_keyboard_shown_", when the user clicks on the X to close the OSK, keyboard controller still thinks that the keyboard is visible and does not pop it back.

@cassandras00 cassandras00 added the bug Bug report label Mar 7, 2024
@magreenblatt
Copy link
Collaborator

Does this reproduce with the CEF Sample Application? Also test with the --multi-threaded-message-loop command-line flag.

@cassandras00
Copy link
Author

I tested it with the sample application, it does reproduce. I also used the command line flag, the behaviour was still the same.

@magreenblatt
Copy link
Collaborator

Thanks 👍

@magreenblatt magreenblatt added windows Windows platform alloy Related to the Alloy runtime labels Mar 7, 2024
@magreenblatt magreenblatt added the help wanted Issue resolution will likely require community contributions label Jul 8, 2024
@magreenblatt
Copy link
Collaborator

Does this reproduce with Chrome runtime + Alloy style? Using M127 or newer, run cefclient --enable-chrome-runtime --use-alloy-style.

@magreenblatt magreenblatt added the needs user feedback Additional feedback required label Aug 5, 2024
@cassandras00
Copy link
Author

Hi, thanks for getting back. I checked it again using version 128.4.5 it works now as expected (even without the additional flags). Thanks a lot!

@783612635
Copy link

783612635 commented Sep 13, 2024

Hello, I have encountered the same issue.
I am currently using version 127.3.6 with a Win32 program written in C++.
I have configured
CefSettings settings;
settings.multi_threaded_message_loop = true;.

It worked very well on version 117.1.4 without any issues, but after upgrading to version 127.3.6, the problem appeared:

1.It requires embedding the same manifest file as cefclient.exe.manifest & compatibility.manifest, otherwise the virtual keyboard cannot be properly triggered;
2.After triggering the virtual keyboard on the touch screen, if the virtual keyboard is closed and you click the input box again, the virtual keyboard cannot be triggered again unless the focus is reset (same as this issue);

Another issue is:
3.It starts detecting DPI scaling and automatically scales the page (of course, I solved this problem with SetZoomLevel).

However, I have not been able to reproduce any of the above three issues in cefclient.exe.
I think perhaps I need to make some additional settings after the upgrade to help it function properly? Or maybe I’ve made some particularly silly mistakes? I’m not sure.

If you have any thoughts, please kindly reply to me.
I really appreciate your help!

@783612635
Copy link

Hello, I have encountered the same issue. I am currently using version 127.3.6 with a Win32 program written in C++. I have configured CefSettings settings; settings.multi_threaded_message_loop = true;.

It worked very well on version 117.1.4 without any issues, but after upgrading to version 127.3.6, the problem appeared:

1.It requires embedding the same manifest file as cefclient.exe.manifest & compatibility.manifest, otherwise the virtual keyboard cannot be properly triggered; 2.After triggering the virtual keyboard on the touch screen, if the virtual keyboard is closed and you click the input box again, the virtual keyboard cannot be triggered again unless the focus is reset (same as this issue);

Another issue is: 3.It starts detecting DPI scaling and automatically scales the page (of course, I solved this problem with SetZoomLevel).

However, I have not been able to reproduce any of the above three issues in cefclient.exe. I think perhaps I need to make some additional settings after the upgrade to help it function properly? Or maybe I’ve made some particularly silly mistakes? I’m not sure.

If you have any thoughts, please kindly reply to me. I really appreciate your help!

Got it! I found that the DPI issue in point 3 can be resolved by using
command_line->AppendSwitchWithValue("--force-device-scale-factor", "1.0");.
However, regarding points 1 and 2 about triggering the virtual keyboard, I can't find the appropriate parameters, even though I have already tried the ones you mentioned earlier, such as --enable-chrome-runtime and --use-alloy-style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alloy Related to the Alloy runtime bug Bug report help wanted Issue resolution will likely require community contributions needs user feedback Additional feedback required windows Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants