diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java b/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java index 1dcd4bf11af..e893a58f9ed 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java @@ -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); }