diff --git a/src/main.cpp b/src/main.cpp index 3957b26..1e8576d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,8 +35,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); if (!QDBusConnection::sessionBus().registerService("org.cutefish.Dock")) { - app.exit(); - return 0; + return -1; } qmlRegisterType("Cutefish.Dock", 1, 0, "DockSettings"); @@ -54,5 +53,9 @@ int main(int argc, char *argv[]) MainWindow w; + if (!QDBusConnection::sessionBus().registerObject("/Dock", &w)) { + return -1; + } + return app.exec(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c6906a1..92f6e8e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -46,7 +46,6 @@ MainWindow::MainWindow(QQuickView *parent) , m_hideTimer(new QTimer(this)) { new DockAdaptor(this); - QDBusConnection::sessionBus().registerObject(QStringLiteral("/Dock"), this); setDefaultAlphaBuffer(false); setColor(Qt::transparent);