8324491: Keyboard layout didn't keep its state if it was changed when dialog was active

Reviewed-by: aivanov, azvegint
This commit is contained in:
Dmitry Markov 2024-12-03 18:37:27 +00:00
parent f37f64df8c
commit 2be07b5f9d

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -319,6 +319,10 @@ final class WInputMethod extends InputMethodAdapter
isLastFocussedActiveClient = isAc;
}
isActive = true;
// Sync currentLocale with the Windows keyboard layout which could be changed
// while the component was inactive.
getLocale();
if (currentLocale != null) {
setLocale(currentLocale, true);
}