Page 1 of 1

How to override mouse cursor?

PostPosted: Tue Jul 02, 2019 1:29 pm
by sandmeteor
I have searched many threads, but I have not found any solution.
Can we change the default cursor (not in the application - this is simple) but the one, that is displayed in the CEF window, for example an arrow or hand cursor when it is above the link.
When I change cursor in my application it works fine but only over my application widgets - it does not change cursor in CEF browser window.

Re: How to override mouse cursor?

PostPosted: Tue Jul 02, 2019 1:45 pm
by magreenblatt
You can change the cursor with CSS/JavaScript.

Re: How to override mouse cursor?

PostPosted: Tue Jul 02, 2019 2:20 pm
by sandmeteor
Ok, it's an idea, but:
-When the page is empty (when you create a browser without loading the page - a blank page), it will not work. The cursor is set to an arrow. Even if you do ExecuteJavaScript.
In addition, Otherwise, I need to load my own image from the application as png.

This is work but when page is loaded.
Code: Select all
 browser _-> GetMainFrame () -> ExecuteJavaScript ("document.body.style.cursor = \" progress \ ";", "", 0);


Is it possible in CEF api to override cursor?

Re: How to override mouse cursor?

PostPosted: Tue Jul 02, 2019 2:29 pm
by magreenblatt
There is a CefBrowserHost::SetMouseCursorChangeDisabled method, but it is not implemented in current CEF versions.

Re: How to override mouse cursor?

PostPosted: Tue Jul 02, 2019 2:38 pm
by sandmeteor
Maybe there is a signal from the CEF that tells the mouse is above the link?

Re: How to override mouse cursor?

PostPosted: Wed Jul 03, 2019 12:45 am
by ndesktop
If you are on Windows, you can try altering the CEF window with SetClassLong(GCL_HCURSOR), or mouse hook+SetCursor, or TrackMouseEvent.

Re: How to override mouse cursor?

PostPosted: Tue Jul 07, 2020 2:43 am
by ajitchavan
magreenblatt wrote:There is a CefBrowserHost::SetMouseCursorChangeDisabled method, but it is not implemented in current CEF versions.


Is CefBrowserHost::SetMouseCursorChangeDisabled implemented in cef 83?

Re: How to override mouse cursor?

PostPosted: Tue Jul 07, 2020 9:11 am
by magreenblatt
ajitchavan wrote:
magreenblatt wrote:There is a CefBrowserHost::SetMouseCursorChangeDisabled method, but it is not implemented in current CEF versions.


Is CefBrowserHost::SetMouseCursorChangeDisabled implemented in cef 83?

You can test with ‘cefclient --mouse-cursor-change-disabled‘