diff -Nru signon-ui-0.17+17.10.20170606/debian/changelog signon-ui-0.17+18.04.20171027+really20160406/debian/changelog --- signon-ui-0.17+17.10.20170606/debian/changelog 2017-10-27 16:33:16.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/debian/changelog 2017-10-27 16:33:16.000000000 +0000 @@ -1,22 +1,14 @@ -signon-ui (0.17+17.10.20170606-0ubuntu1) artful; urgency=medium +signon-ui (0.17+18.04.20171027+really20160406-0ubuntu1) bionic; urgency=medium - * Drop transitional signon-ui package (package was renamed for Utopic) + * Rebuild of 0.17+16.04.20160406-0ubuntu1 source. Versions later than + this crash when trying to add a Google account in KDE + systemsettings. An upstream solution requires unimplemented changes + to KDE Kaccounts KCM, so for now revert to last good working + version. (LP: #1727811) + * Re-drop build dependency on libgstreamer-plugins-base0.10-dev + * Re-drop transitional signon-ui package (package was renamed for Utopic) - -- Jeremy Bicha Tue, 06 Jun 2017 01:05:08 +0000 - -signon-ui (0.17+17.04.20170320-0ubuntu1) zesty; urgency=medium - - * Update for Unity7 session renaming. (LP: #1673984) - - -- Alberto Mardegan Mon, 20 Mar 2017 15:04:17 +0000 - -signon-ui (0.17+17.04.20161109-0ubuntu1) zesty; urgency=medium - - * debian/control: - - Remove dependency on libgstreamer-plugins-base0.10-dev - * Unify QML and QWidget code paths (LP: #1610206) - - -- Alberto Mardegan Wed, 09 Nov 2016 14:07:25 +0000 + -- Rik Mills Fri, 27 Oct 2017 15:57:25 +0100 signon-ui (0.17+16.04.20160406-0ubuntu1) xenial; urgency=medium diff -Nru signon-ui-0.17+17.10.20170606/src/debug.cpp signon-ui-0.17+18.04.20171027+really20160406/src/debug.cpp --- signon-ui-0.17+17.10.20170606/src/debug.cpp 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/debug.cpp 2016-04-06 09:17:28.000000000 +0000 @@ -20,18 +20,10 @@ #include "debug.h" -Q_LOGGING_CATEGORY(DBG_SIGNON_UI, "signon", QtWarningMsg) - int appLoggingLevel = 1; // criticals void setLoggingLevel(int level) { - if (level >= 1) { - QLoggingCategory::setFilterRules("signon.warning=true"); - if (level >= 2) { - QLoggingCategory::setFilterRules("signon.debug=true"); - } - } appLoggingLevel = level; } diff -Nru signon-ui-0.17+17.10.20170606/src/debug.h signon-ui-0.17+18.04.20171027+really20160406/src/debug.h --- signon-ui-0.17+17.10.20170606/src/debug.h 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/debug.h 2016-04-06 09:17:28.000000000 +0000 @@ -20,13 +20,21 @@ #ifndef SIGNON_UI_DEBUG_H #define SIGNON_UI_DEBUG_H -#include - -Q_DECLARE_LOGGING_CATEGORY(DBG_SIGNON_UI) +#include /* 0 - fatal, 1 - critical(default), 2 - info/debug */ extern int appLoggingLevel; +static inline bool debugEnabled() +{ + return appLoggingLevel >= 2; +} + +static inline bool criticalsEnabled() +{ + return appLoggingLevel >= 1; +} + static inline int loggingLevel() { return appLoggingLevel; @@ -34,10 +42,15 @@ void setLoggingLevel(int level); -#define TRACE() \ - qCDebug(DBG_SIGNON_UI) << __FILE__ << __LINE__ << __func__ -#define BLAME() \ - qCWarning(DBG_SIGNON_UI) << __FILE__ << __LINE__ << __func__ +#ifdef DEBUG_ENABLED + #define TRACE() \ + if (debugEnabled()) qDebug() << __FILE__ << __LINE__ << __func__ + #define BLAME() \ + if (criticalsEnabled()) qCritical() << __FILE__ << __LINE__ << __func__ +#else + #define TRACE() while (0) qDebug() + #define BLAME() while (0) qDebug() +#endif #endif // SIGNON_UI_DEBUG_H diff -Nru signon-ui-0.17+17.10.20170606/src/qquick-dialog.cpp signon-ui-0.17+18.04.20171027+really20160406/src/qquick-dialog.cpp --- signon-ui-0.17+17.10.20170606/src/qquick-dialog.cpp 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/qquick-dialog.cpp 2016-04-06 09:17:33.000000000 +0000 @@ -18,6 +18,9 @@ * with this program. If not, see . */ +#define HAS_FOREIGN_QWINDOW (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) || \ + defined(FORCE_FOREIGN_QWINDOW)) + #include "qquick-dialog.h" #include "debug.h" @@ -36,6 +39,22 @@ { } +void Dialog::show(WId parent, ShowMode mode) +{ + create(); +#if HAS_FOREIGN_QWINDOW + if (mode != TopLevel) { + QWindow *parentWindow = QWindow::fromWinId(parent); + if (mode == Transient) { + setTransientParent(parentWindow); + } else if (mode == Embedded) { + setParent(parentWindow); + } + } +#endif + QQuickView::show(); +} + void Dialog::accept() { done(Dialog::Accepted); diff -Nru signon-ui-0.17+17.10.20170606/src/qquick-dialog.h signon-ui-0.17+18.04.20171027+really20160406/src/qquick-dialog.h --- signon-ui-0.17+17.10.20170606/src/qquick-dialog.h 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/qquick-dialog.h 2016-04-06 09:17:28.000000000 +0000 @@ -45,6 +45,8 @@ explicit Dialog(QWindow *parent = 0); ~Dialog(); + void show(WId parent, ShowMode mode); + public Q_SLOTS: void accept(); void reject(); diff -Nru signon-ui-0.17+17.10.20170606/src/request.cpp signon-ui-0.17+18.04.20171027+really20160406/src/request.cpp --- signon-ui-0.17+17.10.20170606/src/request.cpp 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/request.cpp 2016-04-06 09:17:33.000000000 +0000 @@ -18,6 +18,7 @@ * with this program. If not, see . */ +#define HAS_XEMBED (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) #define HAS_FOREIGN_QWINDOW (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) || \ defined(FORCE_FOREIGN_QWINDOW)) #include "request.h" @@ -28,6 +29,9 @@ #include "browser-request.h" #include "debug.h" #include "dialog-request.h" +#if HAS_XEMBED +#include "embed-manager.h" +#endif #include "errors.h" #include "indicator-service.h" #ifndef UNIT_TESTS @@ -77,10 +81,13 @@ } private Q_SLOTS: +#if HAS_XEMBED + void onEmbedError(); +#endif void onIndicatorCallFinished(QDBusPendingCallWatcher *watcher); private: - bool setWindow(QWindow *window); + void setWidget(QWidget *widget); Accounts::Account *findAccount(); bool dispatchToIndicator(); void onIndicatorCallSucceeded(); @@ -93,7 +100,7 @@ QVariantMap m_clientData; bool m_inProgress; Accounts::Manager *m_accountManager; - QPointer m_window; + QPointer m_widget; }; } // namespace @@ -109,7 +116,7 @@ m_parameters(parameters), m_inProgress(false), m_accountManager(0), - m_window(0) + m_widget(0) { if (parameters.contains(SSOUI_KEY_CLIENT_DATA)) { QVariant variant = parameters[SSOUI_KEY_CLIENT_DATA]; @@ -123,43 +130,83 @@ { } -bool RequestPrivate::setWindow(QWindow *window) +void RequestPrivate::setWidget(QWidget *widget) { - if (m_window != 0) { + if (m_widget != 0) { BLAME() << "Widget already set"; - return false; + return; } - m_window = window; + m_widget = widget; +#if HAS_XEMBED + if (embeddedUi() && windowId() != 0) { + TRACE() << "Requesting widget embedding"; + QX11EmbedWidget *embed = + EmbedManager::instance()->widgetFor(windowId()); + QObject::connect(embed, SIGNAL(error(QX11EmbedWidget::Error)), + this, SLOT(onEmbedError()), + Qt::UniqueConnection); + QObject::connect(embed, SIGNAL(containerClosed()), + widget, SLOT(close())); + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(widget); + widget->show(); + /* Delete any previous layout */ + delete embed->layout(); + embed->setLayout(layout); + embed->show(); + return; + } +#endif #if HAS_FOREIGN_QWINDOW if (embeddedUi() && windowId() != 0) { TRACE() << "Requesting window embedding"; QWindow *host = QWindow::fromWinId(windowId()); - window->show(); - window->setParent(host); - return true; + widget->show(); + widget->windowHandle()->setParent(host); + return; } #endif /* If the window has no parent and the webcredentials indicator service is * up, dispatch the request to it. */ if (windowId() == 0 && dispatchToIndicator()) { - return false; + return; } - window->setModality(Qt::WindowModal); - window->show(); + widget->setWindowModality(Qt::WindowModal); + widget->show(); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + if (windowId() != 0) { + TRACE() << "Setting" << widget->effectiveWinId() << "transient for" << windowId(); + XSetTransientForHint(QX11Info::display(), + widget->effectiveWinId(), + windowId()); + } +#endif #if HAS_FOREIGN_QWINDOW if (windowId() != 0) { TRACE() << "Requesting window reparenting"; QWindow *parent = QWindow::fromWinId(windowId()); - window->setTransientParent(parent); + widget->windowHandle()->setTransientParent(parent); } #endif - return true; } +#if HAS_XEMBED +void RequestPrivate::onEmbedError() +{ + Q_Q(Request); + + QX11EmbedWidget *embed = qobject_cast(sender()); + TRACE() << "Embed error:" << embed->error(); + + q->fail(SIGNON_UI_ERROR_EMBEDDING_FAILED, + QString("Embedding signon UI failed: %1").arg(embed->error())); +} +#endif + Accounts::Account *RequestPrivate::findAccount() { if (!m_parameters.contains(SSOUI_KEY_IDENTITY)) @@ -238,8 +285,8 @@ if (watcher->isError()) { /* if the notification could not be delivered to the indicator, show * the widget. */ - if (m_window != 0) - m_window->show(); + if (m_widget != 0) + m_widget->show(); } else { onIndicatorCallSucceeded(); } @@ -266,7 +313,7 @@ #ifdef USE_UBUNTU_WEB_VIEW TRACE() << "Platform:" << QGuiApplication::platformName(); if (QGuiApplication::platformName().startsWith("ubuntu") || - qgetenv("XDG_CURRENT_DESKTOP").startsWith("Unity") || + qgetenv("XDG_CURRENT_DESKTOP") == QByteArray("Unity") || qgetenv("SSOUI_USE_UBUNTU_WEB_VIEW") == QByteArray("1")) { return new UbuntuBrowserRequest(connection, message, parameters, parent); @@ -305,15 +352,7 @@ void Request::setWidget(QWidget *widget) { Q_D(Request); - if (d->setWindow(widget->windowHandle())) { - widget->show(); - } -} - -void Request::setWindow(QWindow *window) -{ - Q_D(Request); - d->setWindow(window); + d->setWidget(widget); } uint Request::identity() const diff -Nru signon-ui-0.17+17.10.20170606/src/request.h signon-ui-0.17+18.04.20171027+really20160406/src/request.h --- signon-ui-0.17+17.10.20170606/src/request.h 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/request.h 2016-04-06 09:17:28.000000000 +0000 @@ -70,7 +70,6 @@ QObject *parent = 0); void setWidget(QWidget *widget); - void setWindow(QWindow *window); protected Q_SLOTS: void fail(const QString &name, const QString &message); diff -Nru signon-ui-0.17+17.10.20170606/src/ubuntu-browser-request.cpp signon-ui-0.17+18.04.20171027+really20160406/src/ubuntu-browser-request.cpp --- signon-ui-0.17+17.10.20170606/src/ubuntu-browser-request.cpp 2017-06-06 01:04:34.000000000 +0000 +++ signon-ui-0.17+18.04.20171027+really20160406/src/ubuntu-browser-request.cpp 2016-04-06 09:17:33.000000000 +0000 @@ -190,7 +190,7 @@ void UbuntuBrowserRequestPrivate::onLoadFinished(bool ok) { - Q_Q(UbuntuBrowserRequest); + Q_Q(const UbuntuBrowserRequest); TRACE() << "Load finished" << ok; @@ -201,7 +201,9 @@ if (!m_dialog->isVisible()) { if (m_responseUrl.isEmpty()) { - q->setWindow(m_dialog); + Dialog::ShowMode mode = (q->windowId() == 0) ? Dialog::TopLevel : + q->embeddedUi() ? Dialog::Embedded : Dialog::Transient; + m_dialog->show(q->windowId(), mode); } else { onFinished(); }