JDK-8199391 : Found cause and fix for bug # 8194873
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9.0.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: x86
  • Submitted: 2018-02-23
  • Updated: 2019-08-02
  • Resolved: 2018-03-09
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
See Bug # 8194873

The cause of the bug is right here:

http://hg.openjdk.java.net/jdk/jdk/file/ba545e52b932/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp#l2718

The jint AwtComponent::GetJavaModifiers() function adds a check for VK_RMENU but VK_MENU will already check both ALT keys.  This causes TWO bits to be set for the right ALT key which breaks many apps including built-in Swing components.

Get rid of the VK_RMENU check ASAP.  Hopefully this can be included in JDK 10.  Don't want to wait until JDK 11 !!!

REGRESSION.  Last worked in version 8u162

ADDITIONAL REGRESSION INFORMATION: 
Was working in Java8


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Remove check for VK_RMENU


Comments
Closing this as duplicate of original report JDK-8194873 which is still open.
09-03-2018

Submitter responded confirming that he has sent a communication to jdk-dev mailing list w.r.t fix. (Adding this to original bug report, JDK-8194873 as well) ======================== A new check for VK_RMENU is generating new modifier bits for the right ALT key causing shortcuts to fail. http://hg.openjdk.java.net/jdk/jdk/file/ba545e52b932/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp#l2718 See bug # 8194873 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8194873 For example: JOptionPane.showConfirmDialog(this, "Do you wish to save file?", "Confirm", JOptionPane.YES_NO_CANCEL_OPTION) When you type left ALT+Y it works, but right ALT+Y does NOT work. This is a regression added in Java9. Please fix asap, thanks. =========================
09-03-2018