diff --git a/src/org/openstreetmap/josm/gui/NavigatableComponent.java b/src/org/openstreetmap/josm/gui/NavigatableComponent.java
index da420a4..0da28eb 100644
--- a/src/org/openstreetmap/josm/gui/NavigatableComponent.java
+++ b/src/org/openstreetmap/josm/gui/NavigatableComponent.java
@@ -314,11 +314,15 @@ public class NavigatableComponent extends JComponent implements Helpful {
     }
 
     protected void updateLocationState() {
-        if (SwingUtilities.getWindowAncestor(this) != null && isShowing()) {
+        if (isVisibleOnScreen()) {
             state = state.usingLocation(this);
         }
     }
 
+    protected boolean isVisibleOnScreen() {
+        return SwingUtilities.getWindowAncestor(this) != null && isShowing();
+    }
+
     /**
      * Gets the current view state. This includes the scale, the current view area and the position.
      * @return The current state.
diff --git a/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java b/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
index 2d8bad6..865e2f4 100644
--- a/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
+++ b/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
@@ -8,7 +8,7 @@ import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.geom.Point2D;
 
-import javax.swing.JFrame;
+import javax.swing.JPanel;
 
 import org.CustomMatchers;
 import org.junit.Before;
@@ -29,6 +29,18 @@ import org.openstreetmap.josm.gui.util.GuiHelper;
  */
 public class NavigatableComponentTest {
 
+    private final class NavigatableComponentMock extends NavigatableComponent {
+        @Override
+        public Point getLocationOnScreen() {
+            return new Point(30, 40);
+        }
+
+        @Override
+        protected boolean isVisibleOnScreen() {
+            return true;
+        }
+    }
+
     private static final int HEIGHT = 200;
     private static final int WIDTH = 300;
     private NavigatableComponent component;
@@ -46,12 +58,7 @@ public class NavigatableComponentTest {
      */
     @Before
     public void setUp() {
-        component = new NavigatableComponent() {
-            @Override
-            public Point getLocationOnScreen() {
-                return new Point(30, 40);
-            }
-        };
+        component = new NavigatableComponentMock();
         component.setBounds(new Rectangle(WIDTH, HEIGHT));
         // wait for the event to be propagated.
         GuiHelper.runInEDTAndWait(new Runnable() {
@@ -60,8 +67,8 @@ public class NavigatableComponentTest {
             }
         });
         component.setVisible(true);
-        JFrame window = new JFrame();
-        window.add(component);
+        JPanel parent = new JPanel();
+        parent.add(component);
         component.updateLocationState();
     }
 
