Bug 130182 - [EFL][WK2] Restore cursor when moving mouse into webview
Summary: [EFL][WK2] Restore cursor when moving mouse into webview
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryuan Choi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-13 01:15 PDT by Ryuan Choi
Modified: 2014-03-17 05:41 PDT (History)
9 users (show)

See Also:


Attachments
suggestion (7.26 KB, patch)
2014-03-13 01:23 PDT, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (7.18 KB, patch)
2014-03-16 19:23 PDT, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (7.15 KB, patch)
2014-03-17 03:12 PDT, Ryuan Choi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryuan Choi 2014-03-13 01:15:30 PDT
Now, ewebkit changed mouse cursor when the type of cursor is changed.

But ewebkit does not know whether other widgets such as elm_entry change the cursor.
So we should restore the cursor when mouser enters on webview not to show wrong cursor.
Comment 1 Ryuan Choi 2014-03-13 01:23:00 PDT
Created attachment 226581 [details]
suggestion
Comment 2 Jinwoo Song 2014-03-13 20:17:45 PDT
Comment on attachment 226581 [details]
suggestion

View in context: https://bugs.webkit.org/attachment.cgi?id=226581&action=review

> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:1165
> +    EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::subscribe(evasObject);

Why don't you follow the alphabetic order?
Comment 3 Ryuan Choi 2014-03-16 19:23:41 PDT
Created attachment 226871 [details]
Patch
Comment 4 Ryuan Choi 2014-03-16 19:23:57 PDT
(In reply to comment #2)
> (From update of attachment 226581 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226581&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/EwkView.cpp:1165
> > +    EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::subscribe(evasObject);
> 
> Why don't you follow the alphabetic order?

Fixed order.
Comment 5 Jinwoo Song 2014-03-17 02:39:23 PDT
Looks good to me.
Comment 6 Gyuyoung Kim 2014-03-17 02:53:33 PDT
Comment on attachment 226871 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=226871&action=review

> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:498
> +        m_useCustomCursor = true;

If possible, I prefer not to keep a member variable for boolean flag. Can't we pass this true/false to updateCursor() as an argument ?

> Source/WebKit2/UIProcess/API/efl/EwkView.h:280
> +    } m_cursorIdentifier; // This is an address, do not free it.

Hmm, is m_cursorIdentifier still an address ?
Comment 7 Ryuan Choi 2014-03-17 03:12:46 PDT
Created attachment 226899 [details]
Patch
Comment 8 Ryuan Choi 2014-03-17 03:15:39 PDT
(In reply to comment #6)
> (From update of attachment 226871 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226871&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/EwkView.cpp:498
> > +        m_useCustomCursor = true;
> 
> If possible, I prefer not to keep a member variable for boolean flag. Can't we pass this true/false to updateCursor() as an argument ?
> 

Unfortunately, we should save the state of cursor for the MOUSE_IN callback.

> > Source/WebKit2/UIProcess/API/efl/EwkView.h:280
> > +    } m_cursorIdentifier; // This is an address, do not free it.
> 
> Hmm, is m_cursorIdentifier still an address ?

Right, I removed the comment.
Comment 9 Gyuyoung Kim 2014-03-17 03:18:40 PDT
Comment on attachment 226871 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=226871&action=review

>>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:498
>>> +        m_useCustomCursor = true;
>> 
>> If possible, I prefer not to keep a member variable for boolean flag. Can't we pass this true/false to updateCursor() as an argument ?
> 
> Unfortunately, we should save the state of cursor for the MOUSE_IN callback.

It looks m_useCustomCursor is only used by updateCursor(). Could you let me know how is this used by the MOUSE_IN callback ?
Comment 10 Ryuan Choi 2014-03-17 03:41:41 PDT
(In reply to comment #9)
> (From update of attachment 226871 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226871&action=review
> 
> >>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:498
> >>> +        m_useCustomCursor = true;
> >> 
> >> If possible, I prefer not to keep a member variable for boolean flag. Can't we pass this true/false to updateCursor() as an argument ?
> > 
> > Unfortunately, we should save the state of cursor for the MOUSE_IN callback.
> 
> It looks m_useCustomCursor is only used by updateCursor(). Could you let me know how is this used by the MOUSE_IN callback ?

Yes and EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent() and setCursor() call updateCursor().

Although we can pass the true/false to updateCursor(), we should keep the any member variable to know which type of cursor(group or image) we will restore in the MOUSE_IN callback.
Comment 11 Gyuyoung Kim 2014-03-17 04:08:42 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (From update of attachment 226871 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=226871&action=review
> > 
> > >>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:498
> > >>> +        m_useCustomCursor = true;
> > >> 
> > >> If possible, I prefer not to keep a member variable for boolean flag. Can't we pass this true/false to updateCursor() as an argument ?
> > > 
> > > Unfortunately, we should save the state of cursor for the MOUSE_IN callback.
> > 
> > It looks m_useCustomCursor is only used by updateCursor(). Could you let me know how is this used by the MOUSE_IN callback ?
> 
> Yes and EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent() and setCursor() call updateCursor().

I can't find "EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent()" in EwkView.cpp. Is it supported by WebKit EFL trunk now ? Please let me know where it is implemented.
Comment 12 Gyuyoung Kim 2014-03-17 04:19:40 PDT
Comment on attachment 226871 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=226871&action=review

>>>>>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:498
>>>>>> +        m_useCustomCursor = true;
>>>>> 
>>>>> If possible, I prefer not to keep a member variable for boolean flag. Can't we pass this true/false to updateCursor() as an argument ?
>>>> 
>>>> Unfortunately, we should save the state of cursor for the MOUSE_IN callback.
>>> 
>>> It looks m_useCustomCursor is only used by updateCursor(). Could you let me know how is this used by the MOUSE_IN callback ?
>> 
>> Yes and EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent() and setCursor() call updateCursor().
>> 
>> Although we can pass the true/false to updateCursor(), we should keep the any member variable to know which type of cursor(group or image) we will restore in the MOUSE_IN callback.
> 
> I can't find "EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent()" in EwkView.cpp. Is it supported by WebKit EFL trunk now ? Please let me know where it is implemented.

I missed to see "EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent()" in this patch. Sorry for noise.
Comment 13 Gyuyoung Kim 2014-03-17 04:22:07 PDT
Comment on attachment 226899 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=226899&action=review

LGTM now.

> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:492
> +    if (cursor.image()) {

Trivial recommendation : How about using isNull() explicitly as below ?

!cursor.image()->isNull()
Comment 14 WebKit Commit Bot 2014-03-17 05:41:11 PDT
Comment on attachment 226899 [details]
Patch

Clearing flags on attachment: 226899

Committed r165730: <http://trac.webkit.org/changeset/165730>
Comment 15 WebKit Commit Bot 2014-03-17 05:41:18 PDT
All reviewed patches have been landed.  Closing bug.