Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog/preferences windows close immediately #18608

Closed
mmeyn opened this issue Jul 14, 2023 · 15 comments
Closed

Dialog/preferences windows close immediately #18608

mmeyn opened this issue Jul 14, 2023 · 15 comments
Assignees
Labels
community Issues particularly suitable for community contributors to work on P2 Priority: Medium regression MS3 Regression from MS3 (3.6.2) UI Visual issues affecting the UI (not notation)

Comments

@mmeyn
Copy link

mmeyn commented Jul 14, 2023

Issue type

UI bug

Bug description

Opening preferences windows often doesn’t work: Sometimes just nothing visible happens, sometimes there is a small window for a fraction of a second, sometimes the windows appear as expected.

This happens both in MuseScore 4.0.2 installed via the Manjaro Linux packet manager and with MuseScore 4.1.0 AppImage. I suppose it’s a system specific bug so please let me know which further information is needed.

Steps to reproduce

Try to open f. e. layout preferences using the menu or the right-click context menu. Try again. And again.

Screenshots/Screen recordings

2023-07-14.19-09-09-00.00.00.000-00.00.25.000.mov

MuseScore Version

4.0.2, 4.1.0

Regression

Yes, this used to work in MuseScore 3.x and now is broken

Operating system

Manjaro Linux

Additional context

No response

@muse-bot muse-bot added regression MS3 Regression from MS3 (3.6.2) UI Visual issues affecting the UI (not notation) labels Jul 14, 2023
@DmitryArefiev
Copy link
Contributor

@mmeyn Do you have two monitors (displays) setup?

@mmeyn
Copy link
Author

mmeyn commented Jul 17, 2023

Yes. But it happens also when I disconnect the second display. A friend of mine has this problem without a second display too.

@bkunda bkunda added the P2 Priority: Medium label Jul 17, 2023
@ydalton
Copy link

ydalton commented Jul 17, 2023

I've seen a bug similar to this happen, on GNOME Wayland at least. My fix is to force the application to run in pure Wayland mode with the environment variable QT_QPA_PLATFORM=wayland.

@mmeyn
Copy link
Author

mmeyn commented Jul 18, 2023

It’s GNOME and X11 on my system. I just tried QT_QPA_PLATFORM=xcb without knowing or understanding what this should do, just similar to what you did, but it doesn’t help. I’m willing to provide more information if someone can tell me what is needed and how to retrieve it, and to try different workarounds/fixes.

@cbjeukendrup
Copy link
Contributor

cbjeukendrup commented Jul 18, 2023

Yes. But it happens also when I disconnect the second display. A friend of mine has this problem without a second display too.

Do you know if this friend is also using Manjaro Linux? Or are there any potentially relevant similarities in your desktop environments / window managers etc.?

And when you run MuseScore from the command line, is there any output that seems relevant?

@mmeyn
Copy link
Author

mmeyn commented Jul 18, 2023

She uses Manjaro Linux with GNOME too.

When I open a menu (by right-clicking on the score or by clicking on a top menu entry like “Layout” the following message appears in the console output:
20:58:28.198 | WARN | main_thread | Qt | QQmlComponent: Created graphical object was not placed in the graphics scene.
When I then click on some menu entry that should open a preferences window, the following message appears:
20:59:49.414 | INFO | main_thread | ActionsDispatcher | dispatch: try call action: edit-style
The message is the same regardless of whether opening the window succeeds. The last word (here edit-style) matches the menu entry/type of requested preferences window.

@bkunda bkunda added the community Issues particularly suitable for community contributors to work on label Jul 21, 2023
@mmeyn
Copy link
Author

mmeyn commented Jul 30, 2023

I just managed to build MuseScore from the current master on my machine. The problem stays the same (sometimes opening the Layout→Style window succeeds, sometimes it doesn’t). The output is in both cases something like the following:

12:08:46.994 | WARN  | main_thread | Qt         | QQmlComponent: Created graphical object was not placed in the graphics scene.
12:08:48.881 | INFO  | main_thread | ActionsDispatcher | dispatch: try call action: edit-style

When using a second monitor there is sometimes the following error:

12:08:56.960 | WARN  | main_thread | Qt         | QQmlComponent: Created graphical object was not placed in the graphics scene.
12:08:56.988 | INFO  | main_thread | ActionsDispatcher | dispatch: try call action: nav-first-control
12:08:57.978 | ERROR | main_thread | NavigationController | requestActivateByName: not found control with name: , panel: ScoreView, section: NotationView
12:08:57.978 | INFO  | main_thread | NavigationController | requestActivateByName: "has:\nScore\n" 
12:08:57.982 | INFO  | main_thread | ActionsDispatcher | dispatch: try call action: edit-style

This error message seems to happen only with a second monitor and seems to be independent from whether opening the window succeeds.

Edit: I just found the dev tools tab in the self-compiled MuseScore. The widget dialog and widget dialog async show the same problem.

@cbjeukendrup
Copy link
Contributor

Idea for debugging: someone could try putting a breakpoint in EditStyle::hideEvent, to see if this method is called when the dialog disappears unexpectedly; and if it is, then that should also give a stack trace, which might clarify why the dialog is being closed.

@mmeyn
Copy link
Author

mmeyn commented Aug 7, 2023

EditStyle::hideEvent is called when closing the window after successfully opening it, or when unsuccessfully opening it.

“crash” while opening:

1  mu::notation::MeasurePropertiesDialog::hideEvent                                                                                               measureproperties.cpp         356  0x55555656a1e0 
2  QWidget::event(QEvent *)                                                                                                                                                          0x7ffff65af4f9 
3  QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
4  QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
5  QWidget::event(QEvent *)                                                                                                                                                          0x7ffff65af71f 
6  QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
7  QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
8  ??                                                                                                                                                                                0x7ffff65cf458 
9  QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
10 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
11 QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *)                                                                  0x7ffff5d45780 
12 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                             0x7ffff5d2a6c5 
13 ??                                                                                                                                                                                0x7ffff0f2f3e0 
14 g_main_context_dispatch                                                                                                                                                           0x7ffff3f0fa31 
15 ??                                                                                                                                                                                0x7ffff3f6ccc9 
16 g_main_context_iteration                                                                                                                                                          0x7ffff3f0d0e2 
17 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                        0x7ffff58eb15c 
18 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                           0x7ffff589b004 
19 QDialog::exec()                                                                                                                                                                   0x7ffff67741eb 
20 mu::ui::InteractiveProvider::openWidgetDialog                                                                                                  interactiveprovider.cpp       595  0x555556928101 
21 mu::ui::InteractiveProvider::open                                                                                                              interactiveprovider.cpp       194  0x55555692f63f 
22 mu::framework::Interactive::open                                                                                                               interactive.cpp               254  0x555555d0f8ab 
23 mu::notation::NotationActionController::openEditStyleDialog                                                                                    notationactioncontroller.cpp  1526 0x555556697b36 
24 std::function<void (std::string const&, mu::actions::ActionData const&)>::operator()(std::string const&, mu::actions::ActionData const&) const std_function.h                591  0x55555635b4a3 
25 mu::actions::ActionsDispatcher::dispatch                                                                                                       actionsdispatcher.cpp         67   0x55555635b4a3 
26 mu::uicomponents::AbstractMenuModel::dispatch                                                                                                  abstractmenumodel.cpp         85   0x55555697689e 
27 mu::uicomponents::AbstractMenuModel::handleMenuItem                                                                                            abstractmenumodel.cpp         80   0x55555697e877 
28 mu::appshell::NavigableAppMenuModel::qt_metacall                                                                                               moc_navigableappmenumodel.cpp 277  0x555556a1b7a3 
29 ??                                                                                                                                                                                0x7ffff72785d4 
30 ??                                                                                                                                                                                0x7ffff71789f1 
31 QV4::QObjectMethod::callInternal(QV4::Value const *, QV4::Value const *, int) const                                                                                               0x7ffff717de16 
32 ??                                                                                                                                                                                0x7ffff72ae154 
33 QObject::event(QEvent *)                                                                                                                                                          0x7ffff58c3d74 
34 QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
35 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
36 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *)                                                                                                          0x7ffff58a125b 
37 ??                                                                                                                                                                                0x7ffff58e72d8 
38 g_main_context_dispatch                                                                                                                                                           0x7ffff3f0fa31 
39 ??                                                                                                                                                                                0x7ffff3f6ccc9 
40 g_main_context_iteration                                                                                                                                                          0x7ffff3f0d0e2 
41 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                        0x7ffff58eb15c 
42 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                           0x7ffff589b004 
43 QCoreApplication::exec()                                                                                                                                                          0x7ffff589c4a3 
44 mu::app::App::run                                                                                                                              app.cpp                       334  0x555555cefd88 
45 main                                                                                                                                           main.cpp                      343  0x5555559ebfbc 

After successfully opening and then closing the window:

1  mu::notation::MeasurePropertiesDialog::hideEvent                                                                                               measureproperties.cpp         356  0x55555656a1e0 
2  QWidget::event(QEvent *)                                                                                                                                                          0x7ffff65af4f9 
3  QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
4  QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
5  QWidgetPrivate::hide_helper()                                                                                                                                                     0x7ffff65ace98 
6  QWidgetPrivate::setVisible(bool)                                                                                                                                                  0x7ffff65ae629 
7  QDialog::setVisible(bool)                                                                                                                                                         0x7ffff6778878 
8  QDialogPrivate::hide(int)                                                                                                                                                         0x7ffff6773d03 
9  QDialog::done(int)                                                                                                                                                                0x7ffff6773d39 
10 ??                                                                                                                                                                                0x7ffff58d1237 
11 QDialogButtonBox::clicked(QAbstractButton *)                                                                                                                                      0x7ffff6705834 
12 ??                                                                                                                                                                                0x7ffff670e734 
13 ??                                                                                                                                                                                0x7ffff58d13f3 
14 QAbstractButton::clicked(bool)                                                                                                                                                    0x7ffff665c357 
15 ??                                                                                                                                                                                0x7ffff665ec0a 
16 ??                                                                                                                                                                                0x7ffff666010c 
17 QAbstractButton::mouseReleaseEvent(QMouseEvent *)                                                                                                                                 0x7ffff66602b0 
18 QWidget::event(QEvent *)                                                                                                                                                          0x7ffff65af1e1 
19 QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
20 QApplication::notify(QObject *, QEvent *)                                                                                                                                         0x7ffff657ddef 
21 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
22 QApplicationPrivate::sendMouseEvent(QWidget *, QMouseEvent *, QWidget *, QWidget *, QWidget * *, QPointer<QWidget>&, bool, bool)                                                  0x7ffff657c12a 
23 ??                                                                                                                                                                                0x7ffff65cced5 
24 ??                                                                                                                                                                                0x7ffff65cec27 
25 QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
26 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
27 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *)                                                                                            0x7ffff5d4192c 
28 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                             0x7ffff5d2a6c5 
29 ??                                                                                                                                                                                0x7ffff0f2f3e0 
30 g_main_context_dispatch                                                                                                                                                           0x7ffff3f0fa31 
31 ??                                                                                                                                                                                0x7ffff3f6ccc9 
32 g_main_context_iteration                                                                                                                                                          0x7ffff3f0d0e2 
33 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                        0x7ffff58eb15c 
34 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                           0x7ffff589b004 
35 QDialog::exec()                                                                                                                                                                   0x7ffff67741eb 
36 mu::ui::InteractiveProvider::openWidgetDialog                                                                                                  interactiveprovider.cpp       595  0x555556928101 
37 mu::ui::InteractiveProvider::open                                                                                                              interactiveprovider.cpp       194  0x55555692f63f 
38 mu::framework::Interactive::open                                                                                                               interactive.cpp               254  0x555555d0f8ab 
39 mu::notation::NotationActionController::openEditStyleDialog                                                                                    notationactioncontroller.cpp  1526 0x555556697b36 
40 std::function<void (std::string const&, mu::actions::ActionData const&)>::operator()(std::string const&, mu::actions::ActionData const&) const std_function.h                591  0x55555635b4a3 
41 mu::actions::ActionsDispatcher::dispatch                                                                                                       actionsdispatcher.cpp         67   0x55555635b4a3 
42 mu::uicomponents::AbstractMenuModel::dispatch                                                                                                  abstractmenumodel.cpp         85   0x55555697689e 
43 mu::uicomponents::AbstractMenuModel::handleMenuItem                                                                                            abstractmenumodel.cpp         80   0x55555697e877 
44 mu::appshell::NavigableAppMenuModel::qt_metacall                                                                                               moc_navigableappmenumodel.cpp 277  0x555556a1b7a3 
45 ??                                                                                                                                                                                0x7ffff72785d4 
46 ??                                                                                                                                                                                0x7ffff71789f1 
47 QV4::QObjectMethod::callInternal(QV4::Value const *, QV4::Value const *, int) const                                                                                               0x7ffff717de16 
48 ??                                                                                                                                                                                0x7ffff72ae154 
49 QObject::event(QEvent *)                                                                                                                                                          0x7ffff58c3d74 
50 QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                           0x7ffff657893f 
51 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                            0x7ffff589c2f8 
52 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *)                                                                                                          0x7ffff58a125b 
53 ??                                                                                                                                                                                0x7ffff58e72d8 
54 g_main_context_dispatch                                                                                                                                                           0x7ffff3f0fa31 
55 ??                                                                                                                                                                                0x7ffff3f6ccc9 
56 g_main_context_iteration                                                                                                                                                          0x7ffff3f0d0e2 
57 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                        0x7ffff58eb15c 
58 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                           0x7ffff589b004 
59 QCoreApplication::exec()                                                                                                                                                          0x7ffff589c4a3 
60 mu::app::App::run                                                                                                                              app.cpp                       334  0x555555cefd88 
61 main                                                                                                                                           main.cpp                      343  0x5555559ebfbc

I removed line numbers, file names, and addresses from the output and called diff -y. The bottommost difference is between 11 QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *) on “crash” and 27 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *) on success.

@cbjeukendrup
Copy link
Contributor

Thanks. Unfortunately, I'm afraid it's difficult to find out where the QHideEvent in question comes from. According to the documentation (https://doc.qt.io/qt-5/qhideevent.html), the spontaneous property tells whether the event comes from "outside". Judging from the stack trace, that might be the case here. I'm afraid it's difficult to debug from where this event is sent and why.

@djfun
Copy link
Contributor

djfun commented Aug 31, 2023

It looks like this is the upstream issue: https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-115848
And here is another affected application: mixxxdj/mixxx#11576

@cbjeukendrup
Copy link
Contributor

The conclusion seems to be that this here is/was the root cause: https://gitlab.gnome.org/GNOME/mutter/-/issues/2820

@djfun
Copy link
Contributor

djfun commented Sep 2, 2023

I rebuilt mutter with the fix included and can confirm, that it indeed fixes the problem.

@cbjeukendrup
Copy link
Contributor

In that case I propose to close this issue, since the cause appears to be outside our control. Is it a correct assumption that the problem will disappear automatically when that fix gets released / rolled out?

@zo0om
Copy link

zo0om commented Nov 9, 2023

In that case I propose to close this issue, since the cause appears to be outside our control. Is it a correct assumption that the problem will disappear automatically when that fix gets released / rolled out?

I can confirm it's fixed in Ubuntu 23.10!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues particularly suitable for community contributors to work on P2 Priority: Medium regression MS3 Regression from MS3 (3.6.2) UI Visual issues affecting the UI (not notation)
Projects
Status: Done
Development

No branches or pull requests

9 participants