Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
11.0
Description
In the Options Dialog, the Panel "Fonts & Colors" and there the subpanel Syntax Pane relies on undocumented ActionEvent#getModifiers behavior.
The constructor of ActionEvent:
Only talks about modifier keys as parameter options:
modifiers - The modifier keys down during event (shift, ctrl, alt, meta). Passing negative parameter is not recommended. Zero value means that no modifiers were passed
The code in the panel checks for the mask for mouse button 1:
if(evt.getModifiers() == InputEvent.BUTTON1_MASK) { // mouse clicked updateLanguageCombobox(); }
On Ubuntu 18.10, OpenJDK 1.8u191:
openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.10.1-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
As the keyboard handling for the ComboBox is also explicitly coded in the panel:
cbLanguage.addKeyListener(new java.awt.event.KeyAdapter() { @Override public void keyReleased(KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ENTER || evt.getKeyCode() == KeyEvent.VK_SPACE) { updateLanguageCombobox(); } } });
Both special cases should be removed and replaced with the default combobox behavior.
The attached screenshot shows the broken state (combobox content for language does not match displayed language).