Skip to content

Commit 860f66d

Browse files
committed
take III on #5597
1 parent b600ff7 commit 860f66d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/app/qgscustomization.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -857,11 +857,6 @@ void QgsCustomization::removeFromLayout( QLayout *theLayout, QWidget * theWidget
857857

858858
void QgsCustomization::preNotify( QObject * receiver, QEvent * event, bool * done )
859859
{
860-
// Crashes especially on Mac if we're not in the main/UI thread, see #5597
861-
if ( QCoreApplication::instance()->thread() != QThread::currentThread() )
862-
{
863-
return;
864-
}
865860
if ( event->type() == QEvent::Show || event->type() == QEvent::MouseButtonPress )
866861
{
867862
QWidget *widget = qobject_cast<QWidget*>( receiver );

src/core/qgsapplication.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ bool QgsApplication::event( QEvent * event )
200200
bool QgsApplication::notify( QObject * receiver, QEvent * event )
201201
{
202202
bool done = false;
203-
emit preNotify( receiver, event, &done );
203+
// Crashes in customization (especially on Mac), if we're not in the main/UI thread, see #5597
204+
if ( thread() == receiver->thread() )
205+
emit preNotify( receiver, event, &done );
204206

205207
if ( done )
206208
return true;

0 commit comments

Comments
 (0)