Commit cbf719d7 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winex11: Remove now unnecessary selected HIMC tracking code.

parent 9f05a79b
......@@ -47,91 +47,15 @@
WINE_DEFAULT_DEBUG_CHANNEL(imm);
#define FROM_X11 ((HIMC)0xcafe1337)
static HIMC *hSelectedFrom = NULL;
static INT hSelectedCount = 0;
static HIMC RealIMC(HIMC hIMC)
{
if (hIMC == FROM_X11)
{
INT i;
HWND wnd = GetFocus();
HIMC winHimc = ImmGetContext(wnd);
for (i = 0; i < hSelectedCount; i++)
if (winHimc == hSelectedFrom[i])
return winHimc;
return NULL;
}
else
return hIMC;
}
static LPINPUTCONTEXT LockRealIMC(HIMC hIMC)
{
HIMC real_imc = RealIMC(hIMC);
if (real_imc)
return ImmLockIMC(real_imc);
else
return NULL;
}
static BOOL UnlockRealIMC(HIMC hIMC)
{
HIMC real_imc = RealIMC(hIMC);
if (real_imc)
return ImmUnlockIMC(real_imc);
else
return FALSE;
}
static BOOL IME_RemoveFromSelected(HIMC hIMC)
{
int i;
for (i = 0; i < hSelectedCount; i++)
if (hSelectedFrom[i] == hIMC)
{
if (i < hSelectedCount - 1)
memmove(&hSelectedFrom[i], &hSelectedFrom[i+1], (hSelectedCount - i - 1)*sizeof(HIMC));
hSelectedCount --;
return TRUE;
}
return FALSE;
}
static void IME_AddToSelected(HIMC hIMC)
{
hSelectedCount++;
if (hSelectedFrom)
hSelectedFrom = HeapReAlloc(GetProcessHeap(), 0, hSelectedFrom, hSelectedCount*sizeof(HIMC));
else
hSelectedFrom = HeapAlloc(GetProcessHeap(), 0, sizeof(HIMC));
hSelectedFrom[hSelectedCount-1] = hIMC;
}
BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
{
LPINPUTCONTEXT lpIMC;
TRACE("%p %s\n",hIMC,(fSelect)?"TRUE":"FALSE");
if (hIMC == FROM_X11)
{
ERR("ImeSelect should never be called from X11\n");
return FALSE;
}
if (!hIMC)
return TRUE;
/* not selected */
if (!fSelect)
return IME_RemoveFromSelected(hIMC);
IME_AddToSelected(hIMC);
if (!hIMC || !fSelect) return TRUE;
/* Initialize our structures */
lpIMC = LockRealIMC(hIMC);
lpIMC = ImmLockIMC(hIMC);
if (lpIMC != NULL)
{
LPIMEPRIVATE myPrivate;
......@@ -141,7 +65,7 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
myPrivate->textfont = NULL;
myPrivate->hwndDefault = NULL;
ImmUnlockIMCC(lpIMC->hPrivate);
UnlockRealIMC(hIMC);
ImmUnlockIMC(hIMC);
}
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment