NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

musescore: none of the panels that dock appear when I try to toggle it (like Timeline, Mixer, etc) #343456

Open adam248 opened 1 month ago

adam248 commented 1 month ago

Describe the bug

In both versions 4.4.1 and 4.4.2, none of the panels that dock appear when trying to toggle them.

This bug was found by 3 people in this issue: https://github.com/NixOS/nixpkgs/pull/342291#issuecomment-2353039367

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install musescore versions 4.4.1 or 4.4.2 and
  2. Open musescore normally
  3. Open any score
  4. Toggle Mixer or Timeline or any other docking panel.

Expected behavior

The docking panels should show and hide after each toggle.

Screenshots

image

Additional context

Notify maintainers

@orivej @doronbehar @vandenoever

Metadata

  - system: `"x86_64-linux"`
 - host os: `Linux 6.11.0, NixOS, 24.05 (Uakari), 24.05.5169.dbebdd67a600`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"home-manager-24.05.tar.gz, nixos-24.05, nixpkgs, unstable"`
 - channels(adam): `"nixos-23.05-23.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

orivej commented 1 month ago

I've investigated this problem with the docks on Qt 6.7.2 - they do not open once the last tab is closed - and it turned out that KDDockWidgets 1 (including the latest 1.7) are designed to restore them incompatibly with the way Qt 6.5+ works.

When MuseScore calls setVisible(true) in DockBase::open to show a previously closed dock widget those panel was also closed, the expected call chain to recreate the panel (frame) is this:

muse::dock::DockWindowActionsController::toggleOpened
muse::dock::DockWindow::toggleDock
muse::dock::DockBase::open
KDDockWidgets::QWidgetAdapter::show
QQuickItem::setVisible(true)
QQuickItemPrivate::setVisible(true)
QQuickItemPrivate::setEffectiveVisibleRecur(calcEffectiveVisible()/*=true*/)
QQuickItemPrivate::itemChange
KDDockWidgets::QWidgetAdapter::itemChange
KDDockWidgets::DockWidgetQuick::event
KDDockWidgets::DockWidgetBase::onShown
KDDockWidgets::DockWidgetBase::Private::maybeRestoreToPreviousPosition
KDDockWidgets::DockWidgetBase::Private::restoreToPreviousPosition
KDDockWidgets::LayoutWidget::restorePlaceholder
KDDockWidgets::DefaultWidgetFactory::createFrame

However, in Qt 6.5 and later the chain ends at QQuickItemPrivate::setEffectiveVisibleRecur since after https://github.com/qt/qtdeclarative/commit/d1b9a4cacfb966cf0a37983d8f8044f3aedf5de3 calcEffectiveVisible() returns false for an item without a parent (and a dock without a panel has none).

KDDockWidgets have redesigned this in https://github.com/KDAB/KDDockWidgets/commit/764385de9f9dd88c2685e42ef65e1daaaca3d679 which went into the 2.0.0 release. Updating to the latest KDDockWidgets (it still supports Qt 6.2+) seems to be the best way forward.

orivej commented 1 month ago

If I revert https://github.com/qt/qtdeclarative/commit/d1b9a4cacfb966cf0a37983d8f8044f3aedf5de3, the closed docks are opened back again, and the only remaining issues that I see:

  1. The mixer dock is almost blank (only channel strip separators are visible) until I switch to a different dock in the same panel and back (e.g. by pressing 'p' twice to open and close piano keyboard).

  2. The navigator dock is a white rectangle the first time it is opened (as long as it was closed when the MuseScore has opened the score) until it is redrawn, e.g. until I pan the view of the score or resize the window.

orivej commented 1 month ago

Thanks! I've reported this with my findings upstream: https://github.com/musescore/MuseScore/issues/24866

UlyssesZh commented 1 month ago

Another upstream issue that shows the same bug: musescore/MuseScore#17438.