mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTUSER] Fix UserSetDefaultInputLang by using reordering
- Move IntReorderKeyboardLayouts function. - Fix UserSetDefaultInputLang function. CORE-11700
This commit is contained in:
parent
f308c6a2bc
commit
b76602ff22
1 changed files with 21 additions and 21 deletions
|
@ -556,6 +556,26 @@ UserHklToKbl(HKL hKl)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// Win: ReorderKeyboardLayouts
|
||||
VOID FASTCALL
|
||||
IntReorderKeyboardLayouts(
|
||||
_Inout_ PWINSTATION_OBJECT pWinSta,
|
||||
_Inout_ PKL pNewKL)
|
||||
{
|
||||
PKL pOldKL = gspklBaseLayout;
|
||||
|
||||
if ((pWinSta->Flags & WSS_NOIO) || pNewKL == pOldKL)
|
||||
return;
|
||||
|
||||
pNewKL->pklPrev->pklNext = pNewKL->pklNext;
|
||||
pNewKL->pklNext->pklPrev = pNewKL->pklPrev;
|
||||
pNewKL->pklNext = pOldKL;
|
||||
pNewKL->pklPrev = pOldKL->pklPrev;
|
||||
pOldKL->pklPrev->pklNext = pNewKL;
|
||||
pOldKL->pklPrev = pNewKL;
|
||||
gspklBaseLayout = pNewKL; /* Should we use UserAssignmentLock? */
|
||||
}
|
||||
|
||||
/*
|
||||
* UserSetDefaultInputLang
|
||||
*
|
||||
|
@ -571,7 +591,7 @@ UserSetDefaultInputLang(HKL hKl)
|
|||
if (!pKl)
|
||||
return FALSE;
|
||||
|
||||
gspklBaseLayout = pKl;
|
||||
IntReorderKeyboardLayouts(IntGetProcessWindowStation(NULL), pKl);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -741,26 +761,6 @@ co_UserActivateKeyboardLayout(
|
|||
return hOldKL;
|
||||
}
|
||||
|
||||
// Win: ReorderKeyboardLayouts
|
||||
VOID FASTCALL
|
||||
IntReorderKeyboardLayouts(
|
||||
_Inout_ PWINSTATION_OBJECT pWinSta,
|
||||
_Inout_ PKL pNewKL)
|
||||
{
|
||||
PKL pOldKL = gspklBaseLayout;
|
||||
|
||||
if ((pWinSta->Flags & WSS_NOIO) || pNewKL == pOldKL)
|
||||
return;
|
||||
|
||||
pNewKL->pklPrev->pklNext = pNewKL->pklNext;
|
||||
pNewKL->pklNext->pklPrev = pNewKL->pklPrev;
|
||||
pNewKL->pklNext = pOldKL;
|
||||
pNewKL->pklPrev = pOldKL->pklPrev;
|
||||
pOldKL->pklPrev->pklNext = pNewKL;
|
||||
pOldKL->pklPrev = pNewKL;
|
||||
gspklBaseLayout = pNewKL; /* Should we use UserAssignmentLock? */
|
||||
}
|
||||
|
||||
/* Win: xxxActivateKeyboardLayout */
|
||||
HKL APIENTRY
|
||||
co_IntActivateKeyboardLayout(
|
||||
|
|
Loading…
Reference in a new issue