Modify

Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#12012 closed defect (fixed)

On Mac OS X, quiting with unsaved changes asks for saving twice

Reported by: Zverikk Owned by: team
Priority: normal Milestone: 17.06
Component: Core Version: latest
Keywords: macosx Cc:

Description

  1. On Mac OS X, run JOSM.
  2. Download an area, modify something.
  3. Press Cmd+Q.

Then, two copies of unsaved changes dialog appear, and you need to click any button there twice.

This does not happen when using File → Exit menu option. I don't think it's a regression, since it's been there for quite a long time. See #11342.

Revision: 8950
Repository Root: http://josm.openstreetmap.de/svn
Relative URL: ^/trunk
Last Changed Author: Don-vip
Last Changed Date: 2015-10-26 01:35:06 +0100 (Mon, 26 Oct 2015)
Build-Date: 2015-10-26 02:33:18
URL: http://josm.openstreetmap.de/svn/trunk
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last Changed Rev: 8950

Identification: JOSM/1.5 (8950 ru) Mac OS X 10.10.5
Memory Usage: 431 MB / 910 MB (274 MB allocated, but free)
Java version: 1.8.0_65, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM

Attachments (0)

Change History (12)

comment:1 Changed 4 years ago by Don-vip

Keywords: javabug added

Can you please tell me what is your keyboard layout?

comment:2 Changed 4 years ago by Zverikk

This can be reproduced on a standard American layout, with an unidentified keyboard (Microsoft Natural 4000).

comment:3 Changed 4 years ago by Don-vip

OK. Before I report again the bug to Oracle, can you please tell me if the bug is reproducible with this small Java program?

import java.awt.event.*;
import javax.swing.*;

public class Bug extends JFrame {

    public Bug() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel panel = new JPanel();
        panel.add(new JLabel("To run on OSX only: Press Cmd-Q once"));
        getContentPane().add(panel);
        AbstractAction action = new AbstractAction() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                                JOptionPane.showMessageDialog(Bug.this, "Hello", "Hello", 
                                                JOptionPane.INFORMATION_MESSAGE);
                        }
        };
        panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                        KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.META_DOWN_MASK), action);
        panel.getActionMap().put(action, action);
        pack();
        }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new Bug().setVisible(true);
            }
        });
    }
}

comment:4 Changed 4 years ago by Zverikk

The action is never called in this program, regardless of how I close it.

comment:5 Changed 4 years ago by Don-vip

And if you replace JLabel by JTextField ? The program works on Windows with event CTRL_DOWN_MASK :(

comment:6 Changed 4 years ago by Zverikk

No, JTextField doesn't work either.
It works when I replace META_ with CTRL_, so I guess Cmd+Q is processed differently.

comment:7 Changed 4 years ago by Don-vip

In 8952/josm:

see #12012 - add log message for shortcut reassignments

comment:8 Changed 4 years ago by Don-vip

Can you please launch the new JOSM latest (r8952) and copy/paste the console output when you launch JOSM? Thanks.

comment:9 Changed 4 years ago by Zverikk

I can apply patches locally and build josm-custom, btw.

INFO: loading plugin 'log4j' (version 31603)
INFO: Reassigning OSX shortcut 'file:downloadreferrers' from Meta to Ctrl because of conflict with ⌘+⌥+D
INFO: Silent shortcut conflict: 'file:downloadreferrers' moved by 'apple-reserved-42' to '⌃+⌥+D'.
INFO: Reassigning OSX shortcut 'core:historyinfo' from Meta to Ctrl because of conflict with ⌘+H
INFO: Silent shortcut conflict: 'core:historyinfo' moved by 'system:hide' to '⌃+H'.
INFO: Could not load tool definition getoffset
INFO: loading plugin 'reverter' (version 31625)
INFO: RemoteControl: adding command "revert_changeset" (handled by RevertChangesetHandler)
INFO: loading plugin 'reltoolbox' (version 31662)
INFO: loading plugin 'apache-commons' (version 31674)
INFO: loading plugin 'jts' (version 31603)
INFO: loading plugin 'geotools' (version 31603)
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
INFO: loading plugin 'utilsplugin2' (version 31655)
INFO: Reassigning OSX shortcut 'tools:undoselection' from Meta to Ctrl because of conflict with ⌘+⇧+Z
INFO: Silent shortcut conflict: 'tools:undoselection' moved by 'system:redo' to '⌃+⇧+Z'.
INFO: Reassigning OSX shortcut 'tools:selecthighway' from Meta to Ctrl because of conflict with ⌘+⌥+W
INFO: Silent shortcut conflict: 'tools:selecthighway' moved by 'system:closeallwindows' to '⌃+⌥+W'.
INFO: loading plugin 'imagery_offset_db' (version 31646)
INFO: loading plugin 'opendata' (version 31680)
INFO: loading plugin 'measurement' (version 31648)
INFO: loading plugin 'geochat' (version 31603)
INFO: loading plugin 'pbf' (version 31603)
INFO: loading plugin 'OpeningHoursEditor' (version 31603)
INFO: loading plugin 'poly' (version 31603)
INFO: loading plugin 'buildings_tools' (version 31640)
INFO: loading plugin 'PicLayer' (version 31603)
INFO: RemoteControl::Accepting remote connections on /127.0.0.1:8111
INFO: RemoteControl::Accepting remote connections on /0:0:0:0:0:0:0:1:8111
INFO: GET https://api.openstreetmap.org/api/0.6/user/details
INFO: Message notifier active (checks every 5 minutes)
INFO: Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console
INFO: GET https://api.openstreetmap.org/api/0.6/user/details (get number of unread messages)
INFO: GET https://api.openstreetmap.org/api/0.6/map?bbox=-15.7344818,11.7806531,-15.7138824,11.7927521
INFO: Reassigning OSX shortcut 'core_multikey:hidingFilter' from Meta to Ctrl because of conflict with ⌘+⌥+H
INFO: Silent shortcut conflict: 'core_multikey:hidingFilter' moved by 'system:hideothers' to '⌃+⌥+H'.
INFO: Reassigning shortcut 'reltoolbox:addremove' from null to 768 because of conflict with =
INFO: Silent shortcut conflict: 'reltoolbox:addremove' moved by 'view:zoominter' to '⌘+⌥+F1'.
INFO: Reassigning OSX shortcut 'reltoolbox:find' from Meta to Ctrl because of conflict with ⌘+⌥+F
INFO: Silent shortcut conflict: 'reltoolbox:find' moved by 'system:search' to '⌃+⌥+F'.
INFO: GET https://a.tile.openstreetmap.org/13/3739/3826.png -> 200
INFO: GET https://c.tile.openstreetmap.org/13/3739/3826.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3739/3825.png -> 200
INFO: GET https://c.tile.openstreetmap.org/13/3736/3825.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3736/3825.png -> 200
INFO: GET https://c.tile.openstreetmap.org/13/3739/3825.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3738/3826.png -> 200
INFO: GET https://c.tile.openstreetmap.org/13/3738/3826.png -> 200
INFO: GET https://a.tile.openstreetmap.org/13/3736/3826.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3736/3826.png -> 200
INFO: GET https://a.tile.openstreetmap.org/13/3737/3826.png -> 200
INFO: GET https://c.tile.openstreetmap.org/13/3737/3826.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3740/3826.png -> 200
INFO: GET https://a.tile.openstreetmap.org/13/3740/3826.png -> 200
INFO: GET https://a.tile.openstreetmap.org/13/3737/3825.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3737/3825.png -> 200
INFO: GET https://c.tile.openstreetmap.org/13/3740/3825.png -> 200
INFO: GET https://a.tile.openstreetmap.org/13/3740/3825.png -> 200
INFO: GET https://b.tile.openstreetmap.org/13/3738/3825.png -> 200
INFO: GET https://a.tile.openstreetmap.org/13/3738/3825.png -> 200
INFO: Registered toolbar action save_as-session overwritten: org.openstreetmap.josm.actions.SessionSaveAsAction gets org.openstreetmap.josm.gui.io.SaveLayersDialog$SaveSessionAction
INFO: Registered toolbar action save_as-session overwritten: org.openstreetmap.josm.gui.io.SaveLayersDialog$SaveSessionAction gets org.openstreetmap.josm.gui.io.SaveLayersDialog$SaveSessionAction

comment:10 Changed 2 years ago by Don-vip

Can you please test with JOSM latest? I think it was a bug of JOSM that I have fixed in r12320

comment:11 Changed 2 years ago by Zverikk

Resolution: fixed
Status: newclosed

You did, thanks a lot!

comment:12 Changed 2 years ago by Don-vip

Keywords: javabug removed
Milestone: 17.06

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.