From 2be07b5f9d2f3f0b885feb08ff10a57824ea5748 Mon Sep 17 00:00:00 2001 From: Dmitry Markov Date: Tue, 3 Dec 2024 18:37:27 +0000 Subject: [PATCH] 8324491: Keyboard layout didn't keep its state if it was changed when dialog was active Reviewed-by: aivanov, azvegint --- .../windows/classes/sun/awt/windows/WInputMethod.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }