Bug 801989 part.6 Set InputContext::mNativeIMEContext on OS/2 r=daveryeo
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 27 Oct 2012 08:35:21 +0900
changeset 111719 6bb7b517fcb3a1973041fe357163fb77e29e579b
parent 111718 d7da33982b8afa502a0951b34af9f74556d1a525
child 111720 19a8337465acd5788d0dfb6ac87c4b02831aaa50
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersdaveryeo
bugs801989
milestone19.0a1
Bug 801989 part.6 Set InputContext::mNativeIMEContext on OS/2 r=daveryeo
widget/os2/nsWindow.cpp
widget/os2/nsWindow.h
--- a/widget/os2/nsWindow.cpp
+++ b/widget/os2/nsWindow.cpp
@@ -2614,16 +2614,28 @@ bool nsWindow::OnImeRequest(MPARAM mp1, 
   else
     rc = true;
 
   spfnImReleaseInstance(mWnd, himi);
 
   return rc;
 }
 
+NS_IMETHODIMP_(InputContext) nsWindow::GetInputContext()
+{
+  HIMI himi;
+  if (sIm32Mod && spfnImGetInstance(mWnd, &himi)) {
+    mInputContext.mNativeIMEContext = static_cast<void*>(himi);
+  }
+  if (!mInputContext.mNativeIMEContext) {
+    mInputContext.mNativeIMEContext = this;
+  }
+  return mInputContext;
+}
+
 //-----------------------------------------------------------------------------
 // Key handler.  Specs for the various text messages are really confused;
 // see other platforms for best results of how things are supposed to work.
 //
 // Perhaps more importantly, the main man listening to these events
 // (besides random bits of javascript) is ender -- see
 // mozilla/editor/base/nsEditorEventListeners.cpp.
 
--- a/widget/os2/nsWindow.h
+++ b/widget/os2/nsWindow.h
@@ -178,20 +178,17 @@ public:
                                       nsEventStatus& aStatus);
   NS_IMETHOD            ReparentNativeWidget(nsIWidget* aNewParent);
 
   NS_IMETHOD_(void)     SetInputContext(const InputContext& aInputContext,
                                         const InputContextAction& aAction)
   {
     mInputContext = aInputContext;
   }
-  NS_IMETHOD_(InputContext) GetInputContext()
-  {
-    return mInputContext;
-  }
+  NS_IMETHOD_(InputContext) GetInputContext();
 
   // nsWindow
   static void           ReleaseGlobals();
 protected:
   // from nsBaseWidget
   virtual void          OnDestroy();
 
   // nsWindow