Closed Bug 964904 Opened 10 years ago Closed 6 years ago

Expose a preference to forward all touch events to the system app in order to build some devtools

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vingtetun, Unassigned)

References

Details

Attachments

(3 files, 3 obsolete files)

Kats, I would like to enable the possibility to build a small devtool in the system app for touch events. In order to do so we will need to receive the touchmove events in the main window.

Let me know what do you think.
Attachment #8366793 - Flags: feedback?(bugmail.mozilla)
Comment on attachment 8366793 [details] [diff] [review]
forward.touchmove.to.mainprocess.patch

Review of attachment 8366793 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/ipc/TabParent.cpp
@@ +871,5 @@
>      return false;
>    }
>  
>    SendRealTouchEvent(event);
> +  return mCaptureTouchEvents;

I don't think this part will do what you want, but I don't really know what you're trying to do so I can't say for sure. I think the right approach here is to make TabParent::GetEventCapturer return null if you don't want the fast-path taken.

But what is the tool you're trying to write?
Attachment #8366793 - Flags: feedback?(bugmail.mozilla)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #2)
> Comment on attachment 8366793 [details] [diff] [review]
> forward.touchmove.to.mainprocess.patch
> 
> Review of attachment 8366793 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/ipc/TabParent.cpp
> @@ +871,5 @@
> >      return false;
> >    }
> >  
> >    SendRealTouchEvent(event);
> > +  return mCaptureTouchEvents;
> 
> I don't think this part will do what you want, but I don't really know what
> you're trying to do so I can't say for sure. I think the right approach here
> is to make TabParent::GetEventCapturer return null if you don't want the
> fast-path taken.
> 
> But what is the tool you're trying to write?

It's not clear yet for the exact detail but one of the first thing I'm interested in, is to see the fluffing area based on the position of the finger on the screen. It will helps to understand where it does not work (i'm pretty sure fluffing fails when someone tries to click a 'clear' button into a text field for example).

I'm pretty sure I will have to do an other patch in the platform to expose the list of candidates to the system app in order to see live what's happening but that's way out of the scope of this bug.

It may also help to visually see, by drawing the touch path, things like https://bugzilla.mozilla.org/show_bug.cgi?id=947337#c48 and determine if this is a user error or a APZC error.
Ah yeah, that sounds useful!
Comment on attachment 8366793 [details] [diff] [review]
forward.touchmove.to.mainprocess.patch

Review of attachment 8366793 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch! This will help me write a tool to visually show touches on firefox os.

::: dom/ipc/TabParent.cpp
@@ +61,5 @@
>  #include <algorithm>
> +#include "nsIObserverService.h"
> +#include "nsIPrefBranch.h"
> +#include "nsIPrefService.h"
> +#include "mozilla/Preferences.h"

Nit: These should probably be moved up a bit to keep a semblance of order.

@@ +1922,5 @@
> +    NS_ASSERTION(prefs, "Bad observer call!");
> +
> +    NS_ConvertUTF16toUTF8 pref(aData);
> +    if (pref.EqualsLiteral(DEBUG_TOUCH_EVENTS)) {
> +      return prefs->GetBoolPref(DEBUG_TOUCH_EVENTS, &mCaptureTouchEvents);

I think this line is problematic, because you're setting `mCaptureTouchEvents` to the value of the pref, whereas line 231 you're setting it to the opposite.

::: dom/ipc/TabParent.h
@@ +50,5 @@
>  
>  class ContentDialogParent : public PContentDialogParent {};
>  
>  class TabParent : public PBrowserParent 
>                  , public nsITabParent 

Nit: Trailing spaces.
Attachment #8366793 - Flags: feedback+
Since I already rebased and fixed the patch to do some tests, I'll just upload it here for your convenience.
Here are the changes I did on top of your patch after rebasing it.
Blocks: 985886
It is worth noting that when disabling the fast path, even though it has the intended effect of routing `touchmove` events through the system app, seems to cause problems in the scrolling of the homescreen, making it difficult to go from one screen to the next.
Rebased again, and filed bug 1005880 about the homescreen problem.
Depends on: 1005880
No longer depends on: 1005880
No longer blocks: 965293
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: