Ticket #11209: ButTheBugIsStillPresent3.patch

File ButTheBugIsStillPresent3.patch, 2.9 KB (added by akks, 11 years ago)

(I am afraid we cannot do anything to work-around the bug on Linux in JOSM code. Here is the trivial version and with it the keyboard still hangs after pressing Enter in tag table multiple times (until ibus restart ).

  • src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

     
    3535import javax.swing.AbstractAction;
    3636import javax.swing.JComponent;
    3737import javax.swing.JLabel;
     38import javax.swing.JOptionPane;
    3839import javax.swing.JPanel;
    3940import javax.swing.JPopupMenu;
    4041import javax.swing.JScrollPane;
     
    10301031            if (!isEnabled())
    10311032                return;
    10321033            if (tagTable.getSelectedRowCount() == 1) {
    1033                 int row = tagTable.getSelectedRow();
    1034                 editHelper.editTag(row, false);
     1034                String inputValue = JOptionPane.showInputDialog("Please input a value");
    10351035            } else if (membershipTable.getSelectedRowCount() == 1) {
    10361036                int row = membershipTable.getSelectedRow();
    10371037                editMembership(row);
  • src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java

     
    7777     * Register this object as AWTEventListener
    7878     */
    7979    public void register() {
    80         try {
    81             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
    82         } catch (SecurityException ex) {
    83             Main.warn(ex);
    84         }
    85         timer = new Timer(0, new ActionListener() {
    86             @Override
    87             public void actionPerformed(ActionEvent e) {
    88                 timer.stop();
    89                 if (set.remove(releaseEvent.getKeyCode()) && enabled) {
    90                     if (isFocusInMainWindow()) {
    91                         for (KeyPressReleaseListener q: keyListeners) {
    92                             q.doKeyReleased(releaseEvent);
    93                         }
    94                     }
    95                 }
    96             }
    97         });
    9880    }
    9981
    10082    /**
     
    10284     * lists of listeners are not cleared!
    10385     */
    10486    public void unregister() {
    105         timer.stop();
    106         set.clear();
    107         if (!keyListeners.isEmpty()) {
    108             Main.warn(tr("Some of the key listeners forgot to remove themselves: {0}"), keyListeners.toString());
    109         }
    110         if (!modifierListeners.isEmpty()) {
    111             Main.warn(tr("Some of the key modifier listeners forgot to remove themselves: {0}"), modifierListeners.toString());
    112         }
    113         try {
    114             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
    115         } catch (SecurityException ex) {
    116             Main.warn(ex);
    117         }
    11887    }
    11988
    12089    private void processKeyEvent(KeyEvent e) {