Bug 1181714 - nsTextStore should store previous focused document manager until new document manager actually gets focus. r=m_kato, a=lmandel
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 09 Jul 2015 17:30:07 +0900
changeset 275301 93c0c5e4ec30e683d8b1d6caacd21b090673a68c
parent 275300 479be71536ad6fa5275a175946961abf245b77d6
child 275302 ec483a9f4dbf2da3e25beef55c183c064b0f796a
child 275304 87a93931c09af3f58c9a914ef33495444f9d98d4
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato, lmandel
bugs1181714
milestone40.0
Bug 1181714 - nsTextStore should store previous focused document manager until new document manager actually gets focus. r=m_kato, a=lmandel
widget/windows/nsTextStore.cpp
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -4142,19 +4142,20 @@ nsTextStore::OnFocusChange(bool aGotFocu
           GetIMEEnabledName(aContext.mIMEState.mEnabled),
           NS_ConvertUTF16toUTF8(aContext.mHTMLInputType).get(),
           sThreadMgr.get(), sEnabledTextStore.get()));
 
   if (NS_WARN_IF(!IsInTSFMode())) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
+  nsRefPtr<ITfDocumentMgr> prevFocusedDocumentMgr;
+
   // If currently sEnableTextStore has focus, notifies TSF of losing focus.
   if (ThinksHavingFocus()) {
-    nsRefPtr<ITfDocumentMgr> prevFocusedDocumentMgr;
     DebugOnly<HRESULT> hr =
       sThreadMgr->AssociateFocus(
         sEnabledTextStore->mWidget->GetWindowHandle(),
         nullptr, getter_AddRefs(prevFocusedDocumentMgr));
     NS_ASSERTION(SUCCEEDED(hr), "Disassociating focus failed");
     NS_ASSERTION(prevFocusedDocumentMgr == sEnabledTextStore->mDocumentMgr,
                  "different documentMgr has been associated with the window");
   }