Aric Stewart : msctf: Implement ITfKeystrokeMgr::GetForeground.

Alexandre Julliard julliard at winehq.org
Mon May 11 09:10:48 CDT 2009


Module: wine
Branch: master
Commit: cbf4671d4825b2ae3d4c4853b8d0aa0afc651820
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cbf4671d4825b2ae3d4c4853b8d0aa0afc651820

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri May  8 08:51:18 2009 -0500

msctf: Implement ITfKeystrokeMgr::GetForeground.

---

 dlls/msctf/tests/inputprocessor.c |    2 +-
 dlls/msctf/threadmgr.c            |   18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index 5ab645d..ac993cc 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -406,7 +406,7 @@ static void test_KeystrokeMgr(void)
     test_KEV_OnSetFocus = SINK_EXPECTED;
     hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,tid,sink,TRUE);
     ok(SUCCEEDED(hr),"ITfKeystrokeMgr_AdviseKeyEventSink failed\n");
-    todo_wine ok(test_KEV_OnSetFocus == SINK_FIRED, "KeyEventSink_OnSetFocus not fired as expected\n");
+    ok(test_KEV_OnSetFocus == SINK_FIRED, "KeyEventSink_OnSetFocus not fired as expected\n");
     hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,tid,sink,TRUE);
     ok(hr == CONNECT_E_ADVISELIMIT,"Wrong return, expected CONNECT_E_ADVISELIMIT\n");
     hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,cid,sink,TRUE);
diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c
index 5ee08dd..277923e 100644
--- a/dlls/msctf/threadmgr.c
+++ b/dlls/msctf/threadmgr.c
@@ -79,6 +79,7 @@ typedef struct tagACLMulti {
     LONG activationCount;
 
     ITfKeyEventSink *forgroundKeyEventSink;
+    CLSID forgroundTextService;
 
     struct list CurrentPreservedKeys;
 
@@ -535,9 +536,14 @@ static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface,
     if (fForeground)
     {
         if (This->forgroundKeyEventSink)
+        {
+            ITfKeyEventSink_OnSetFocus(This->forgroundKeyEventSink, FALSE);
             ITfKeyEventSink_Release(This->forgroundKeyEventSink);
+        }
         ITfKeyEventSink_AddRef(check);
+        ITfKeyEventSink_OnSetFocus(check, TRUE);
         This->forgroundKeyEventSink = check;
+        This->forgroundTextService = textservice;
     }
     return S_OK;
 }
@@ -569,6 +575,7 @@ static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface,
     {
         ITfKeyEventSink_Release(This->forgroundKeyEventSink);
         This->forgroundKeyEventSink = NULL;
+        This->forgroundTextService = GUID_NULL;
     }
     return S_OK;
 }
@@ -577,8 +584,15 @@ static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface,
         CLSID *pclsid)
 {
     ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+    TRACE("(%p) %p\n",This,pclsid);
+    if (!pclsid)
+        return E_INVALIDARG;
+
+    if (IsEqualCLSID(&This->forgroundTextService,&GUID_NULL))
+        return S_FALSE;
+
+    *pclsid = This->forgroundTextService;
+    return S_OK;
 }
 
 static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface,




More information about the wine-cvs mailing list