Bug 1336515: Fix assertions in TIPMessageHandler instantiation on non-touchscreen devices; r=jimm a=gchang
authorAaron Klotz <aklotz@mozilla.com>
Fri, 03 Feb 2017 11:21:15 -0700
changeset 378430 507aa1988da3a293fb48209dbded8c1ccf9b52d2
parent 378429 7f88a549492704d04ae61d6219c08362e3b2c1ea
child 378431 002105261cee33e56ddabc6dc1eb642e3d0c60a8
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, gchang
bugs1336515
milestone53.0a2
Bug 1336515: Fix assertions in TIPMessageHandler instantiation on non-touchscreen devices; r=jimm a=gchang 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) {