-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Steps to reproduce:
- Start LMMS with the default project (with at least one Triple Oscillator).
- Add another Triple Oscillator (or another instrument).
- Open the instrument window of one of the instruments.
- Switch between instruments using the left / right arrow on the top of the instrument window.
- Save.
- Load the file that you have just saved.
The last selected instrument will be restored with a very large height that coincides with the instrument window's height.
The main cause is that there are two methods which store different types of heights as the attribute height
in the node track
under the parent trackcontainer
:
- The method
Track::saveSettings
stores the height of the track under that node. - The method
InstrumentTrackWindow::saveSettings
stores the window geometry of the instrument window by delegating toMainWindow::saveWidgetState
. This step stores the height of the instrument window into the aforementioned node which causes the faulty restoring of the track height.
The switching of the instrument windows is relevant for this bug because at one point this action calls InstrumentTrackView::getInstrumentTrackWindow
which installs a hook for the serialization so that InstrumentTrackWindow::saveSettings
is called as well. Without this action no hook is installed and everything is fine. You can see this if you add a break point to SerializingObject::setHook
and then execute the steps described above.
So everything action that leads to the installation of the aforementioned hook or a direct call to InstrumentTrackWindow::saveSettings
will likely trigger this bug.
See the closed pull request #3692 for more details.