Opened 14 years ago
Closed 14 years ago
#6875 closed defect (fixed)
[Patch-2] Data Layer can be changed after selecting another layer
| Reported by: | Larry0ua | Owned by: | team |
|---|---|---|---|
| Priority: | critical | Milestone: | |
| Component: | Core | Version: | latest |
| Keywords: | Cc: |
Description
The bug reproduction steps:
- Open JOSM (latest or tested)
- Download some area.
- Open some GPX file.
- In Layers toggle dialog select GPX layer.
- Move mouse on some object from data layer.
- Try to move that object, change its properties - all works, but should not as we selected GPX layer as current.
Attachments (2)
Change History (11)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
The problem may be even deeper... I cannot reach that code, may some layerChangeListener forgot to remove mouseMotionListener from data layers? That is as addition for that you mentioned.
by , 14 years ago
| Attachment: | patch.diff added |
|---|
patch for josm\core\src\org\openstreetmap\josm\gui\MapFrame.java
comment:4 by , 14 years ago
comment:5 by , 14 years ago
| Summary: | Data Layer can be changed after selecting another layer → [Patch] Data Layer can be changed after selecting another layer |
|---|
Thanks for your work.
Next time, please change the summary to get your work better noticed.
comment:6 by , 14 years ago
This doesn't fix the issue completely though. If you switch between the modes using shortcuts when the gpx layer is active, you can manipulate the non-active layer again.
Given that most users won't change modes deliberately when in a gpx/imagery/etc. layer, the patch will probably avoid 80+% of confusing cases though.
But as said, I get the impression it's intentional that the modes should work when the edit layer(s) is passive. Is that correct?
PS: Testing the patch, I can't see that it fixes #6447?
(EDIT:grammar/spelling)
comment:7 by , 14 years ago
I see #6447 - it is not fixed, and it looks like quite another bug.
I'm attaching next generation fix for current bug.
comment:8 by , 14 years ago
| Summary: | [Patch] Data Layer can be changed after selecting another layer → [Patch-2] Data Layer can be changed after selecting another layer |
|---|



It actually seems like this is intentional?
From MapView.java
private void setActiveLayer(Layer layer, boolean setEditLayer) { // ... snip ... /* This only makes the buttons look disabled. Disabling the actions as well requires * the user to re-select the tool after i.e. moving a layer. While testing I found * that I switch layers and actions at the same time and it was annoying to mind the * order. This way it works as visual clue for new users */ for (Enumeration<AbstractButton> e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) { AbstractButton x=e.nextElement(); x.setEnabled(((MapMode)x.getAction()).layerIsSupported(layer)); }From DrawAction.java
@Override protected void updateEnabledState() { setEnabled(getEditLayer() != null); }getEditLayer returns one of the datalayers even if it's not active.
I agree that it's somewhat confusing though. I'd vote for a change.