diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-21 18:53:06 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-21 18:53:06 +0200 |
commit | 306690e137c2bb031020ba3c2c1515ba731a23a5 (patch) | |
tree | 81b242212f693af25c350668e3b72efbce9b224a /widget | |
parent | 4549256c2b685782587f2ccad6a105c0392492c7 (diff) | |
parent | 0a744b1cfeecdd2487d9166792ac5234edc9ee6a (diff) | |
download | uxp-306690e137c2bb031020ba3c2c1515ba731a23a5.tar.gz |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into data-transfer_1
Diffstat (limited to 'widget')
-rw-r--r-- | widget/GfxInfoX11.cpp | 8 | ||||
-rw-r--r-- | widget/MouseEvents.h | 21 | ||||
-rw-r--r-- | widget/nsGUIEventIPC.h | 39 |
3 files changed, 51 insertions, 17 deletions
diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 4297aaa930..48fc3dbb5b 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. diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h index 643132618f..442ac41e82 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h @@ -43,22 +43,31 @@ namespace dom { class WidgetPointerHelper { public: - bool convertToPointer; uint32_t pointerId; uint32_t tiltX; uint32_t tiltY; - bool retargetedByPointerCapture; + uint32_t twist; + float tangentialPressure; + bool convertToPointer; - WidgetPointerHelper() : convertToPointer(true), pointerId(0), tiltX(0), tiltY(0), - retargetedByPointerCapture(false) {} + WidgetPointerHelper() + : pointerId(0) + , tiltX(0) + , tiltY(0) + , twist(0) + , tangentialPressure(0) + , convertToPointer(true) + { + } void AssignPointerHelperData(const WidgetPointerHelper& aEvent) { - convertToPointer = aEvent.convertToPointer; pointerId = aEvent.pointerId; tiltX = aEvent.tiltX; tiltY = aEvent.tiltY; - retargetedByPointerCapture = aEvent.retargetedByPointerCapture; + twist = aEvent.twist; + tangentialPressure = aEvent.tangentialPressure; + convertToPointer = aEvent.convertToPointer; } }; diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h index 7a9d870d9a..e45189bb10 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -219,6 +219,34 @@ struct ParamTraits<mozilla::WidgetWheelEvent> }; template<> +struct ParamTraits<mozilla::WidgetPointerHelper> +{ + typedef mozilla::WidgetPointerHelper paramType; + + static void Write(Message* aMsg, const paramType& aParam) + { + WriteParam(aMsg, aParam.pointerId); + WriteParam(aMsg, aParam.tiltX); + WriteParam(aMsg, aParam.tiltY); + 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) + { + bool rv; + rv = ReadParam(aMsg, aIter, &aResult->pointerId) && + ReadParam(aMsg, aIter, &aResult->tiltX) && + ReadParam(aMsg, aIter, &aResult->tiltY) && + ReadParam(aMsg, aIter, &aResult->twist) && + ReadParam(aMsg, aIter, &aResult->tangentialPressure); + return rv; + } +}; + +template<> struct ParamTraits<mozilla::WidgetMouseEvent> { typedef mozilla::WidgetMouseEvent paramType; @@ -226,13 +254,13 @@ struct ParamTraits<mozilla::WidgetMouseEvent> static void Write(Message* aMsg, const paramType& aParam) { WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam)); + WriteParam(aMsg, static_cast<mozilla::WidgetPointerHelper>(aParam)); WriteParam(aMsg, aParam.mIgnoreRootScrollFrame); WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.mReason)); WriteParam(aMsg, static_cast<paramType::ContextMenuTriggerType>( aParam.mContextMenuTrigger)); WriteParam(aMsg, static_cast<paramType::ExitFromType>(aParam.mExitFrom)); WriteParam(aMsg, aParam.mClickCount); - WriteParam(aMsg, aParam.pointerId); } static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) @@ -243,12 +271,13 @@ struct ParamTraits<mozilla::WidgetMouseEvent> paramType::ExitFromType exitFrom = 0; rv = ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEventBase*>(aResult)) && + ReadParam(aMsg, aIter, + static_cast<mozilla::WidgetPointerHelper*>(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<paramType::Reason>(reason); aResult->mContextMenuTrigger = static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger); @@ -290,8 +319,6 @@ struct ParamTraits<mozilla::WidgetPointerEvent> WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam)); WriteParam(aMsg, aParam.mWidth); WriteParam(aMsg, aParam.mHeight); - WriteParam(aMsg, aParam.tiltX); - WriteParam(aMsg, aParam.tiltY); WriteParam(aMsg, aParam.mIsPrimary); } @@ -301,8 +328,6 @@ struct ParamTraits<mozilla::WidgetPointerEvent> ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(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; } |