diff -r b7e2027ec4bd -r 27f9c1f11598 main/MainWindow.cpp
--- a/main/MainWindow.cpp
+++ b/main/MainWindow.cpp
@@ -1878,7 +1878,44 @@
 void
 MainWindow::layerInAView(Layer *layer, bool inAView)
 {
-    MainWindowBase::layerInAView(layer, inAView);
+//    std::cerr << "MainWindow::layerInAView(" << layer << "," << inAView << ")" << std::endl;
+
+    if (!inAView) removeLayerEditDialog(layer);
+
+    // Check whether we need to add or remove model from play source
+    Model *model = layer->getModel();
+    if (model) {
+        Model *source = model->getSourceModel();
+        if (inAView) {
+            m_playSource->addModel(model);
+            if (source && source != model) {
+                m_playSource->addModel(source);
+            }
+        } else {
+            bool found = false;
+            for (int i = 0; i < m_paneStack->getPaneCount(); ++i) {
+                Pane *pane = m_paneStack->getPane(i);
+                if (!pane) continue;
+                for (int j = 0; j < pane->getLayerCount(); ++j) {
+                    Layer *pl = pane->getLayer(j);
+                    if (pl && (pl->getModel() == model ||
+                               pl->getModel() == source)) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (found) break;
+            }
+            if (!found) {
+                m_playSource->removeModel(model);
+                if (source && source != model) {
+                    m_playSource->removeModel(source);
+                }
+            }
+        }
+    }
+
+    updateMenuStates();
 }
 
 void
