Bug 350758 - Opening K/QFileDialog twice in a row freezes the parent app
Summary: Opening K/QFileDialog twice in a row freezes the parent app
Status: RESOLVED FIXED
Alias: None
Product: frameworks-frameworkintegration
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 349387 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-29 16:52 UTC by speeddemon574
Modified: 2016-01-11 11:05 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description speeddemon574 2015-07-29 16:52:02 UTC
If I try changing the sound file that a notification uses when it pops up, the system settings window hangs.

Reproducible: Always

Steps to Reproduce:
1. Open System Settings
2. Go to "Notifications"
3. Click any one of the notifications
4. In the "Play a sound" felid click the folder on the right-hand side
5. Close this window (you don't need to select a sound file)
6. Click another notification
7. Click the folder in the "Play a sound" field again


Actual Results:  
The file menu doesn't open and the program refuses to do anything afterwards (can't close it using the "X" in the corner, can't go back to "Overview", etc.)

Expected Results:  
The file menu should come back up whenever I click it a second time, and not hang.

It might be nice if the menu would go to where the sound files are (/usr/share/sounds/) when you first open it.
Comment 1 Martin Klapetek 2015-07-29 16:59:38 UTC
Backtrace when frozen:

Thread 1 (Thread 0x7f4b536ec780 (LWP 18680)):
#0  0x00007f4b4f91a8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f4b4b208ebc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f4b4b208fcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f4b5029f1ed in QEventDispatcherGlib::processEvents (this=0x9308b0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#4  0x00007f4b4475aece in QPAEventDispatcherGlib::processEvents (this=0x9308b0, flags=...) at eventdispatchers/qeventdispatcher_glib.cpp:115
#5  0x00007f4b50223042 in QEventLoop::processEvents (this=0x7ffefbb5ca70, flags=...) at kernel/qeventloop.cpp:128
#6  0x00007f4b50223303 in QEventLoop::exec (this=0x7ffefbb5ca70, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f4b514c96a3 in QDialog::exec (this=0xea44a0) at dialogs/qdialog.cpp:541
#8  0x00007f4b40870363 in KDEPlatformFileDialogHelper::exec (this=0xf07ac0) at /home/mck182/kf5-dev/src/frameworkintegration/src/platformtheme/kdeplatformfiledialoghelper.cpp:290
#9  0x00007f4b514c9654 in QDialog::exec (this=0xef8b70) at dialogs/qdialog.cpp:537
#10 0x00007f4b4f3364d1 in KUrlRequester::KUrlRequesterPrivate::_k_slotOpenDialog (this=0xe411c0) at /home/mck182/kf5-dev/src/kio/src/widgets/kurlrequester.cpp:450
#11 0x00007f4b4f3371a6 in KUrlRequester::qt_static_metacall (_o=0xe40f90, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7ffefbb5ce50) at /home/mck182/kf5-dev/build/kio/src/widgets/moc_kurlrequester.cpp:155
#12 0x00007f4b502698e2 in QMetaObject::activate (sender=0xe46360, signalOffset=7, local_signal_index=2, argv=0x7ffefbb5ce50) at kernel/qobject.cpp:3716
#13 0x00007f4b502690d4 in QMetaObject::activate (sender=0xe46360, m=0x7f4b518d3e20 <QAbstractButton::staticMetaObject>, local_signal_index=2, argv=0x7ffefbb5ce50) at kernel/qobject.cpp:3582
#14 0x00007f4b516be590 in QAbstractButton::clicked (this=0xe46360, _t1=false) at .moc/moc_qabstractbutton.cpp:298
#15 0x00007f4b513944b5 in QAbstractButtonPrivate::emitClicked (this=0xe46870) at widgets/qabstractbutton.cpp:534
#16 0x00007f4b51394444 in QAbstractButtonPrivate::click (this=0xe46870) at widgets/qabstractbutton.cpp:527
#17 0x00007f4b51395922 in QAbstractButton::mouseReleaseEvent (this=0xe46360, e=0x7ffefbb5d7a0) at widgets/qabstractbutton.cpp:1132
#18 0x00007f4b512c3d12 in QWidget::event (this=0xe46360, event=0x7ffefbb5d7a0) at kernel/qwidget.cpp:8656
#19 0x00007f4b51395760 in QAbstractButton::event (this=0xe46360, e=0x7ffefbb5d7a0) at widgets/qabstractbutton.cpp:1089
#20 0x00007f4b5144afc7 in QPushButton::event (this=0xe46360, e=0x7ffefbb5d7a0) at widgets/qpushbutton.cpp:673
#21 0x00007f4b51275ffc in QApplicationPrivate::notify_helper (this=0x8b46e0, receiver=0xe46360, e=0x7ffefbb5d7a0) at kernel/qapplication.cpp:3722
---Type <return> to continue, or q <return> to quit---
#22 0x00007f4b51273db7 in QApplication::notify (this=0x7ffefbb5e3d0, receiver=0xe46360, e=0x7ffefbb5d7a0) at kernel/qapplication.cpp:3280
#23 0x00007f4b5022634c in QCoreApplication::notifyInternal (this=0x7ffefbb5e3d0, receiver=0xe46360, event=0x7ffefbb5d7a0) at kernel/qcoreapplication.cpp:932
#24 0x00007f4b51278d73 in QCoreApplication::sendSpontaneousEvent (receiver=0xe46360, event=0x7ffefbb5d7a0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#25 0x00007f4b512725eb in QApplicationPrivate::sendMouseEvent (receiver=0xe46360, event=0x7ffefbb5d7a0, alienWidget=0xe46360, nativeWidget=0xa40dc0, buttonDown=0x7f4b518e3c70 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:2751
#26 0x00007f4b512eb46c in QWidgetWindow::handleMouseEvent (this=0xb2b210, event=0x7ffefbb5de70) at kernel/qwidgetwindow.cpp:506
#27 0x00007f4b512ea17b in QWidgetWindow::event (this=0xb2b210, event=0x7ffefbb5de70) at kernel/qwidgetwindow.cpp:173
#28 0x00007f4b51275ffc in QApplicationPrivate::notify_helper (this=0x8b46e0, receiver=0xb2b210, e=0x7ffefbb5de70) at kernel/qapplication.cpp:3722
#29 0x00007f4b51273562 in QApplication::notify (this=0x7ffefbb5e3d0, receiver=0xb2b210, e=0x7ffefbb5de70) at kernel/qapplication.cpp:3164
#30 0x00007f4b5022634c in QCoreApplication::notifyInternal (this=0x7ffefbb5e3d0, receiver=0xb2b210, event=0x7ffefbb5de70) at kernel/qcoreapplication.cpp:932
#31 0x00007f4b50b44415 in QCoreApplication::sendSpontaneousEvent (receiver=0xb2b210, event=0x7ffefbb5de70) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#32 0x00007f4b50b3d91d in QGuiApplicationPrivate::processMouseEvent (e=0x11233c0) at kernel/qguiapplication.cpp:1796
#33 0x00007f4b50b3ceba in QGuiApplicationPrivate::processWindowSystemEvent (e=0x11233c0) at kernel/qguiapplication.cpp:1598
#34 0x00007f4b50b267ed in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:572
#35 0x00007f4b4475acbc in userEventSourceDispatch (source=0x9290c0) at eventdispatchers/qeventdispatcher_glib.cpp:70
#36 0x00007f4b4b208c3d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007f4b4b208f20 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007f4b4b208fcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007f4b5029f1ed in QEventDispatcherGlib::processEvents (this=0x9308b0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#40 0x00007f4b4475aece in QPAEventDispatcherGlib::processEvents (this=0x9308b0, flags=...) at eventdispatchers/qeventdispatcher_glib.cpp:115
#41 0x00007f4b50223042 in QEventLoop::processEvents (this=0x7ffefbb5e2c0, flags=...) at kernel/qeventloop.cpp:128
#42 0x00007f4b50223303 in QEventLoop::exec (this=0x7ffefbb5e2c0, flags=...) at kernel/qeventloop.cpp:204
#43 0x00007f4b50226a24 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1185
#44 0x00007f4b50b3cc66 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1532
#45 0x00007f4b51272d83 in QApplication::exec () at kernel/qapplication.cpp:2956
#46 0x000000000042562c in main (argc=1, argv=0x7ffefbb5e4e8) at /home/mck182/kf5-dev/src/systemsettings/app/main.cpp:55
Comment 2 David Edmundson 2015-09-26 16:46:39 UTC
*** Bug 349387 has been marked as a duplicate of this bug. ***
Comment 3 Weng Xuetian 2015-09-30 18:04:15 UTC
Git commit 6ae74671ca68e9444db618207d662ad5d1c16f31 by Weng Xuetian.
Committed on 30/09/2015 at 18:03.
Pushed by xuetianweng into branch 'master'.

Fix random file dialog not showing up problem.

When using QDialog to implement QPlatformDialog there will be a issue,
that QDialog will use a dummy invisible to make Qt aware that a modal
dialog exists. But for our usecase, this invisible dialog will show up
after our own qdialog and cause our dialog not accept any input.

The original workaround is to hide our dialog and show it again, but
this will hit QTBUG-48248 and our dialog will not show up at all
randomly. To avoid this, we delegate the call to show() on our
QDialog with a timer.
REVIEW: 125208

M  +10   -0    autotests/kfiledialog_unittest.cpp
M  +4    -0    autotests/kfiledialogqml_unittest.cpp
M  +15   -1    src/platformtheme/kdeplatformfiledialogbase.cpp
M  +5    -0    src/platformtheme/kdeplatformfiledialogbase_p.h
M  +23   -12   src/platformtheme/kdeplatformfiledialoghelper.cpp
M  +1    -0    src/platformtheme/kdeplatformfiledialoghelper.h

http://commits.kde.org/frameworkintegration/6ae74671ca68e9444db618207d662ad5d1c16f31