Mouse pointer disappears use touch mode
-
What version of the product are you using?
- 49.0.1
-
What architecture x86 or x64?
- Both
-
On what operating system?
- Win7, Win10
-
Are you using
WinForms,WPForOffScreen?- WinForms, WPF
-
What steps will reproduce the problem?
- Use ChromiumWebBrowser (WinForm) in WindowsFormsHost in a child window (WPF).
- Open a page(e.g. https://github.com/cefsharp/cefsharp) successfully.
- Scroll the page use touch mode.
- Use touch mode to close the child window and return to the parent window.
- The mouse pointer disappears in the parent window.
Is solved,Thx
@ccnucheng Can you tell me your solution
I'm facing the same problem, any suggestions?
What version of the product are you using? 71.0.0
What architecture x86 or x64? x86
On what operating system? Win10
Are you using WinForms, WPF or OffScreen? WinForms in WPF project
https://github.com/cefsharp/CefSharp/issues/1833
发件人: Tyr [email protected] 发送时间: 2019年3月11日 16:34 收件人: cefsharp/CefSharp 抄送: ccnucheng; Mention 主题: Re: [cefsharp/CefSharp] Mouse pointer disappears use touch mode (#1886)
I'm facing the same problem, any suggestions?
― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/cefsharp/CefSharp/issues/1886#issuecomment-471448284, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALhG0hkoTmgPDQDxf3Kp_CQo9l2v0Hf0ks5vVhUygaJpZM4LKUOy.
That solution didn't work for me.
-What version of the product are you using? 63.0.3 -What architecture x86 or x64? x86 -On what operating system? Win10, Tablet Surface Pro with touch screen and connected keyboard with a touchpad -Are you using WinForms, WPF or OffScreen? WinForms, WPF -Additional information A library WmTouchDevice is used. CefSharp.WinForms in CefWindowsFormsHost.
What steps will reproduce the problem?
Create a main window and a button "Open child window"
Create a child window with Browser and Close button
Run the app, press "Open child window"
Touch somewhere in browser
Touch "Close" button
Result: mouse cursor is invisible in the main window.
Source code files are attached. src.zip
According to my solution, you need to modify the CEF source code
发件人: helen-dwa [email protected] 发送时间: 2019年5月7日 10:41 收件人: cefsharp/CefSharp 抄送: ccnucheng; Mention 主题: Re: [cefsharp/CefSharp] Mouse pointer disappears use touch mode (#1886)
That solution didn't work for me.
-What version of the product are you using? 63.0.3 -What architecture x86 or x64? x86 -On what operating system? Win10, Tablet Surface Pro with touch screen and connected keyboard with a touchpad -Are you using WinForms, WPF or OffScreen? WinForms, WPF -Additional information A library WmTouchDevice is used. CefSharp.WinForms in CefWindowsFormsHost.
What steps will reproduce the problem?
Create a main window and a button "Open child window" Create a child window with Browser and Close button Run the app, press "Open child window" Touch somewhere in browser Touch "Close" button
Result: mouse cursor is invisible in the main window.
Source code files are attached. src.ziphttps://github.com/cefsharp/CefSharp/files/3150581/src.zip
― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/cefsharp/CefSharp/issues/1886#issuecomment-489885177, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AC4ENUVBL5DCGM2PCSB6HFTPUDT65ANCNFSM4CZJIOZA.
How exactly to modify?
hi @ccnucheng are you able to help with the required code that was changed to solve this - we are seeing the same issue many thanks in advance thanks
Here is what is causing the problem:
The Cef Browser is hiding the Cursor when a touch event occurs.
Add the following code to you host form on load event:
MouseEnter += (o, mE) => Cursor.Show();
MouseLeave += (o, mE) => Cursor.Show();
This will ensure the cursor is reset to visible.
NOTE: In our solution we are using DockStyle.Fill. So attaching to Form works well. If you are not using Fill you may want to attach the MouseEnter/MouseExit to you browser Container.
NOTE: I have tried attaching these events to the Cef control itself and they do not trigger !
MouseEnter += (o, mE) => Cursor.Show(); MouseLeave += (o, mE) => Cursor.Show();
Thank you. This solution worked well in a project of the "application" type (produces .exe file). It was not working in the dll module project. I have another solution.
// class to fix the bug: mouse cursor disappears if to close CEF browser by touch
public class CefTouchShowCursor
{
[DllImport("User32.dll")]
private static extern int ShowCursor(bool bShow);
[DllImport("user32.dll")]
static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
[DllImport("user32.dll")]
public static extern IntPtr SetCursor(IntPtr handle);
public static void ShowCursor()
{
IntPtr handle = LoadCursor(IntPtr.Zero, 32649); // 32649 - "arrow", 32512 - "handle" mouse pointer
SetCursor(handle);
ShowCursor(true);
}
}