Bug 1336515: Fix assertions in TIPMessageHandler instantiation on non-touchscreen devices; r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Fri, 03 Feb 2017 11:21:15 -0700
changeset 341036 e54a95d4fec35114fa7d2b7bf3df84695c1732d2
parent 341035 22651b5d537d8f6d0c09a2148f4c1017ab0a368e
child 341037 8598941437bf858986323f1ef313d0c1c24ef7fa
push id86615
push userkwierso@gmail.com
push dateTue, 07 Feb 2017 01:52:08 +0000
treeherdermozilla-inbound@f0453084d86e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1336515
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1336515: Fix assertions in TIPMessageHandler instantiation on non-touchscreen devices; r=jimm MozReview-Commit-ID: FCQBD6hB4oL
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -450,18 +450,20 @@ private:
     mMessages[4] = ::RegisterWindowMessage(L"ProgrammabilityCaretVisibility");
     mMessages[5] = ::RegisterWindowMessage(L"CaretTrackingUpdateIPHidden");
     mMessages[6] = ::RegisterWindowMessage(L"CaretTrackingUpdateIPInfo");
 
     mHook = ::SetWindowsHookEx(WH_GETMESSAGE, &TIPHook, nullptr,
                                ::GetCurrentThreadId());
     MOZ_ASSERT(mHook);
 
-    if (!IsWin10OrLater() && !sProcessCaretEventsStub) {
-      // tiptsf loads when STA COM is first initialized, so it should be present
+    // On touchscreen devices, tiptsf.dll will have been loaded when STA COM was
+    // first initialized.
+    if (!IsWin10OrLater() && GetModuleHandle(L"tiptsf.dll") &&
+        !sProcessCaretEventsStub) {
       sTipTsfInterceptor.Init("tiptsf.dll");
       DebugOnly<bool> ok = sTipTsfInterceptor.AddHook("ProcessCaretEvents",
           reinterpret_cast<intptr_t>(&ProcessCaretEventsHook),
           (void**) &sProcessCaretEventsStub);
       MOZ_ASSERT(ok);
     }
 
     if (!sSendMessageTimeoutWStub) {