Skip to content

Fix clip name not showing on empty MIDI clips#8413

Open
alexandra-russell wants to merge 1 commit into
LMMS:masterfrom
alexandra-russell:fix/7808-empty-midi-clip-name
Open

Fix clip name not showing on empty MIDI clips#8413
alexandra-russell wants to merge 1 commit into
LMMS:masterfrom
alexandra-russell:fix/7808-empty-midi-clip-name

Conversation

@alexandra-russell

Copy link
Copy Markdown

Summary

Fixes #7808. Empty MIDI clips did not display their name for two reasons:

  • resetName() and changeName() never called update(), so the cached pixmap was not invalidated after renaming
  • The drawTextBox condition suppressed the name text box for beat-type clips, which is how empty clips are classified (std::all_of on an empty range returns true)

Changes

  • Call update() after setName() in both resetName() and changeName()
  • Relax the drawTextBox condition to allow the name on clips with no notes

Note

Empty beat clips in the Pattern editor will now also show their name if renamed. This was not previously possible but is harmless since their default name is empty. If undesirable, the condition could be tightened by also checking the track type.

Test plan

  • Create an empty MIDI clip (add an instrument, do not open the piano roll)
  • Right-click the clip and rename it
  • Verify the name appears immediately without needing to hover
  • Add notes to the clip, rename again, verify name still displays
  • Reset the name (right-click > Reset name) and verify it clears

Renaming never invalidated the cached pixmap, and the name text box
was suppressed for beat-type clips (which is what empty clips are
classified as). Call update() after setName() in changeName() and
resetName(), and allow the name box on empty clips.

Note: empty beat clips in the Pattern editor will now also show
their name if renamed. This was not previously possible but is
harmless since their default name is empty. If undesirable, the
condition could be tightened by also checking the track type.

Fixes LMMS#7808
@rubiefawn rubiefawn added bug gui needs code review A functional code review is currently required for this PR needs testing This pull request needs more testing labels May 30, 2026
@Itreza2

Itreza2 commented May 30, 2026

Copy link
Copy Markdown
Contributor

I tested it and it works as expected.

Empty beat clips in the Pattern editor will now also show their name if renamed. This was not previously possible but is harmless since their default name is empty.

I'm not a fan of this at all. It feels really weird that beat clips only shows their name when empty. They should either display it all the time or never, and the decision was seemingly taken to not allow them to.

If undesirable, the condition could be tightened by also checking the track type.

The track containing MidiClips are always of type Instrument, so it can't be used to solve this issue.
It also isn't possible to discriminate based on the TrackContainer type, as beat clips can be used in the SongEditor with legacysebb (if I'm not mistaken).

I tend to like the approach of #7836 a lot more: a midi clip should be a melody clip by default when created in the song editor, and a beat clip in the pattern editor.

}

void MidiClipView::resetName() { m_clip->setName(""); }
void MidiClipView::resetName() { m_clip->setName(""); update(); }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really useful to call update() here ?
I tested with this change reverted and haven't noticed any difference.

RenameDialog rename_dlg( s );
rename_dlg.exec();
m_clip->setName( s );
update();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug gui needs code review A functional code review is currently required for this PR needs testing This pull request needs more testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty MIDI clips don't display the clip name

3 participants