From 8a6f654e95cb25ad167cbc028373245e671db461 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Apr 2018 20:28:00 +0200 Subject: Bug 1299197 Part1: Refine WidgetPointerHelper native in moebius --- widget/MouseEvents.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'widget') diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h index 643132618..f214ec22b 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h @@ -43,21 +43,27 @@ namespace dom { class WidgetPointerHelper { public: - bool convertToPointer; uint32_t pointerId; uint32_t tiltX; uint32_t tiltY; + bool convertToPointer; bool retargetedByPointerCapture; - WidgetPointerHelper() : convertToPointer(true), pointerId(0), tiltX(0), tiltY(0), - retargetedByPointerCapture(false) {} + WidgetPointerHelper() + : pointerId(0) + , tiltX(0) + , tiltY(0) + , convertToPointer(true) + , retargetedByPointerCapture(false) + { + } void AssignPointerHelperData(const WidgetPointerHelper& aEvent) { - convertToPointer = aEvent.convertToPointer; pointerId = aEvent.pointerId; tiltX = aEvent.tiltX; tiltY = aEvent.tiltY; + convertToPointer = aEvent.convertToPointer; retargetedByPointerCapture = aEvent.retargetedByPointerCapture; } }; -- cgit v1.2.3 From e43cde864f88cf264dae56ee6201a84091fec5b4 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Apr 2018 20:30:07 +0200 Subject: Bug 1299197 Part2: Serialize WidgetPointerHelper in IPC message native in moebius --- widget/nsGUIEventIPC.h | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'widget') diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h index 7a9d870d9..e06e3784a 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -218,6 +218,30 @@ struct ParamTraits } }; +template<> +struct ParamTraits +{ + typedef mozilla::WidgetPointerHelper paramType; + + static void Write(Message* aMsg, const paramType& aParam) + { + WriteParam(aMsg, aParam.pointerId); + WriteParam(aMsg, aParam.tiltX); + WriteParam(aMsg, aParam.tiltY); + // We don't serialize convertToPointer and retargetedByPointerCapture since + // they are temporarily variable and should be reset to default. + } + + static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) + { + bool rv; + rv = ReadParam(aMsg, aIter, &aResult->pointerId) && + ReadParam(aMsg, aIter, &aResult->tiltX) && + ReadParam(aMsg, aIter, &aResult->tiltY); + return rv; + } +}; + template<> struct ParamTraits { @@ -226,13 +250,13 @@ struct ParamTraits static void Write(Message* aMsg, const paramType& aParam) { WriteParam(aMsg, static_cast(aParam)); + WriteParam(aMsg, static_cast(aParam)); WriteParam(aMsg, aParam.mIgnoreRootScrollFrame); WriteParam(aMsg, static_cast(aParam.mReason)); WriteParam(aMsg, static_cast( aParam.mContextMenuTrigger)); WriteParam(aMsg, static_cast(aParam.mExitFrom)); WriteParam(aMsg, aParam.mClickCount); - WriteParam(aMsg, aParam.pointerId); } static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) @@ -243,12 +267,13 @@ struct ParamTraits paramType::ExitFromType exitFrom = 0; rv = ReadParam(aMsg, aIter, static_cast(aResult)) && + ReadParam(aMsg, aIter, + static_cast(aResult)) && ReadParam(aMsg, aIter, &aResult->mIgnoreRootScrollFrame) && ReadParam(aMsg, aIter, &reason) && ReadParam(aMsg, aIter, &contextMenuTrigger) && ReadParam(aMsg, aIter, &exitFrom) && - ReadParam(aMsg, aIter, &aResult->mClickCount) && - ReadParam(aMsg, aIter, &aResult->pointerId); + ReadParam(aMsg, aIter, &aResult->mClickCount); aResult->mReason = static_cast(reason); aResult->mContextMenuTrigger = static_cast(contextMenuTrigger); @@ -290,8 +315,6 @@ struct ParamTraits WriteParam(aMsg, static_cast(aParam)); WriteParam(aMsg, aParam.mWidth); WriteParam(aMsg, aParam.mHeight); - WriteParam(aMsg, aParam.tiltX); - WriteParam(aMsg, aParam.tiltY); WriteParam(aMsg, aParam.mIsPrimary); } @@ -301,8 +324,6 @@ struct ParamTraits ReadParam(aMsg, aIter, static_cast(aResult)) && ReadParam(aMsg, aIter, &aResult->mWidth) && ReadParam(aMsg, aIter, &aResult->mHeight) && - ReadParam(aMsg, aIter, &aResult->tiltX) && - ReadParam(aMsg, aIter, &aResult->tiltY) && ReadParam(aMsg, aIter, &aResult->mIsPrimary); return rv; } -- cgit v1.2.3 From 09f456b2808224e7707e51bfab8957ef067154e4 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Apr 2018 22:18:52 +0200 Subject: moebius#71: DOM - Pointer Events - improvements https://github.com/MoonchildProductions/moebius/pull/71 --- widget/MouseEvents.h | 9 ++++++--- widget/nsGUIEventIPC.h | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'widget') diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h index f214ec22b..442ac41e8 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h @@ -46,15 +46,17 @@ public: uint32_t pointerId; uint32_t tiltX; uint32_t tiltY; + uint32_t twist; + float tangentialPressure; bool convertToPointer; - bool retargetedByPointerCapture; WidgetPointerHelper() : pointerId(0) , tiltX(0) , tiltY(0) + , twist(0) + , tangentialPressure(0) , convertToPointer(true) - , retargetedByPointerCapture(false) { } @@ -63,8 +65,9 @@ public: pointerId = aEvent.pointerId; tiltX = aEvent.tiltX; tiltY = aEvent.tiltY; + twist = aEvent.twist; + tangentialPressure = aEvent.tangentialPressure; convertToPointer = aEvent.convertToPointer; - retargetedByPointerCapture = aEvent.retargetedByPointerCapture; } }; diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h index e06e3784a..e45189bb1 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -228,8 +228,10 @@ struct ParamTraits WriteParam(aMsg, aParam.pointerId); WriteParam(aMsg, aParam.tiltX); WriteParam(aMsg, aParam.tiltY); - // We don't serialize convertToPointer and retargetedByPointerCapture since - // they are temporarily variable and should be reset to default. + WriteParam(aMsg, aParam.twist); + WriteParam(aMsg, aParam.tangentialPressure); + // We don't serialize convertToPointer since it's temporarily variable and + // should be reset to default. } static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) @@ -237,7 +239,9 @@ struct ParamTraits bool rv; rv = ReadParam(aMsg, aIter, &aResult->pointerId) && ReadParam(aMsg, aIter, &aResult->tiltX) && - ReadParam(aMsg, aIter, &aResult->tiltY); + ReadParam(aMsg, aIter, &aResult->tiltY) && + ReadParam(aMsg, aIter, &aResult->twist) && + ReadParam(aMsg, aIter, &aResult->tangentialPressure); return rv; } }; -- cgit v1.2.3 From 2828e5db828d13ef662817f37f55709ab302db51 Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 20 Apr 2018 17:44:53 -0500 Subject: Use -1 instead of 0 to indicate absent glxtest_pipe fd --- widget/GfxInfoX11.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'widget') diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 4297aaa93..48fc3dbb5 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -23,7 +23,7 @@ NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug) #endif // these global variables will be set when firing the glxtest process -int glxtest_pipe = 0; +int glxtest_pipe = -1; pid_t glxtest_pid = 0; nsresult @@ -50,8 +50,8 @@ GfxInfo::GetData() // to understand this function, see bug 639842. We retrieve the OpenGL driver information in a // separate process to protect against bad drivers. - // if glxtest_pipe == 0, that means that we already read the information - if (!glxtest_pipe) + // if glxtest_pipe == -1, that means that we already read the information + if (glxtest_pipe == -1) return; enum { buf_size = 1024 }; @@ -60,7 +60,7 @@ GfxInfo::GetData() &buf, buf_size-1); // -1 because we'll append a zero close(glxtest_pipe); - glxtest_pipe = 0; + glxtest_pipe = -1; // bytesread < 0 would mean that the above read() call failed. // This should never happen. If it did, the outcome would be to blacklist anyway. -- cgit v1.2.3