Skip to content

Commit ca8b123

Browse files
Merge pull request #26266 from mathesoncalum/25848-more_palette_crash
Fix #25848: Crash when dragging item from "More" palette to parent palette
2 parents 8dad5d4 + 0b33059 commit ca8b123

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/palette/qml/MuseScore/Palette/internal/MoreElementsPopup.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ StyledPopupView {
5252
property size cellSize
5353
property bool drawGrid
5454

55+
readonly property bool isDragInProgress: masterPalette.state == "drag" || customPalette.state == "drag"
56+
5557
property int maxHeight: 400
5658
contentHeight: column.implicitHeight
5759
contentWidth: 300

src/palette/qml/MuseScore/Palette/internal/PaletteTree.qml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,18 @@ StyledListView {
320320

321321
onClosed: {
322322
enablePaletteAnimations = false;
323-
palettePopup.active = false;
323+
// Deactivating the loader while dragging will cause a crash (#25848), so defer the deactivation...
324+
if (!moreElementsPopup.isDragInProgress) {
325+
palettePopup.active = false;
326+
}
327+
}
328+
329+
onIsDragInProgressChanged: {
330+
const deactivationWasDeferred = !moreElementsPopup.isOpened && palettePopup.active
331+
if (!moreElementsPopup.isDragInProgress && deactivationWasDeferred) {
332+
// We're now safe to deactivate the loader...
333+
palettePopup.active = false
334+
}
324335
}
325336

326337
function scrollToPopupBottom() {

0 commit comments

Comments
 (0)