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

fix: cross-thread parenting failure #949

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/notification/notification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Notification::Notification(QWidget *parent)
setMinimumSize(PLUGIN_BACKGROUND_MIN_SIZE, PLUGIN_BACKGROUND_MIN_SIZE);
connect(this, &Notification::dndModeChanged, this, &Notification::refreshIcon);
QtConcurrent::run([this](){
m_dbus = new QDBusInterface("org.deepin.dde.Notification1", "/org/deepin/dde/Notification1", "org.deepin.dde.Notification1", QDBusConnection::sessionBus(), this);
m_dbus.reset(new QDBusInterface("org.deepin.dde.Notification1", "/org/deepin/dde/Notification1", "org.deepin.dde.Notification1"));
// Refresh icon for the first time, cause org.deepin.dde.Notification1 might depend on dock's DBus,
// we should not call org.deepin.dde.Notification1 in the main thread before dock's dbus is initialized.
// Just refresh icon in the other thread.
Expand Down
2 changes: 1 addition & 1 deletion plugins/notification/notification.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private Q_SLOTS:

private:
QIcon m_icon;
QDBusInterface *m_dbus;
QScopedPointer<QDBusInterface> m_dbus;
bool m_dndMode;
};

Expand Down