Mouse cursor should indicate loading of a website

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Mouse cursor should indicate loading of a website

Postby Czarek » Wed Jan 09, 2013 9:59 pm

Hi,

In CEF 1 cefclient there is no indication of website being loaded, the mouse
cursor does not change in any way, this is a problem when there is lag, as I
see a white page for a long period of time and this is bad user experience,
I'm not sure whether application hanged up or what.

In CEF 3 cefclient it works fine, mouse cursor is changing while website is loading,
but I'm not sure how it got implemented, when I search cefclient sources for
"isLoading" I only find ClientHandler::SetLoading() in "client_handler_win.cpp":

Code: Select all
void ClientHandler::SetLoading(bool isLoading) {
  ASSERT(m_EditHwnd != NULL && m_ReloadHwnd != NULL && m_StopHwnd != NULL);
  EnableWindow(m_EditHwnd, TRUE);
  EnableWindow(m_ReloadHwnd, !isLoading);
  EnableWindow(m_StopHwnd, isLoading);
}


This code does not change cursor in any way, it only affects the state of browser
buttons. Is this internally implemented in libcef? Can we have a similar
functionality in CEF 1?

Czarek.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Mouse cursor should indicate loading of a website

Postby magreenblatt » Thu Jan 10, 2013 3:10 pm

It's likely somewhere in the Content API layer. You can do the same in your CEF1 application by changing the cursor in OnLoadStart and OnLoadEnd (make sure it's a load event for the main frame). Also, you may need a timer to restore the wait cursor at some set interval.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Mouse cursor should indicate loading of a website

Postby Czarek » Thu Jan 10, 2013 3:58 pm

magreenblatt wrote:It's likely somewhere in the Content API layer. You can do the same in your CEF1 application by changing the cursor in OnLoadStart and OnLoadEnd (make sure it's a load event for the main frame). Also, you may need a timer to restore the wait cursor at some set interval.


The loading may also happen later when using dynamic scripting, in CefBrowser
I see a method called IsLoading(), would it be fine to use it with a 50 ms timer
that calls this method and changes the cursor appropriately? Unfortunately I see
that this method is only available in CEF 3.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 183 guests