Emit notify_layering_changed() more often; especially when we remove the only region...
authorCarl Hetherington <carl@carlh.net>
Sat, 31 Dec 2011 13:25:50 +0000 (13:25 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 31 Dec 2011 13:25:50 +0000 (13:25 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11126 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/playlist.cc

index c11e55779c4302769f0d64fa8b6a6aa84dbd06c7..bcc203694e687699ede5de682370270b221fd545 100644 (file)
@@ -2397,8 +2397,6 @@ Playlist::relayer ()
                return;
        }
 
-       bool changed = false;
-
        /* Build up a new list of regions on each layer, stored in a set of lists
           each of which represent some period of time on some layer.  The idea
           is to avoid having to search the entire region list to establish whether
@@ -2490,16 +2488,16 @@ Playlist::relayer ()
                        layers[j][k].push_back (*i);
                }
 
-               if ((*i)->layer() != j) {
-                       changed = true;
-               }
-
                (*i)->set_layer (j);
        }
 
-       if (changed) {
-               notify_layering_changed ();
-       }
+       /* It's a little tricky to know when we could avoid calling this; e.g. if we are
+          relayering because we just removed the only region on the top layer, nothing will
+          appear to have changed, but the StreamView must still sort itself out.  We could
+          probably keep a note of the top layer last time we relayered, and check that,
+          but premature optimisation &c...
+       */
+       notify_layering_changed ();
 
        /* This relayer() may have been called as a result of a region removal, in which
           case we need to setup layering indices so account for the one that has just