Code review comment for lp:~nick-dedekind/qtubuntu/menuTheme

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> + // queue the windowPropertyChanged signal. If it's emitted directly, the
> platformWindow will not yet be set for the window.
> + QMetaObject::invokeMethod(mNativeInterface, "windowPropertyChanged",
> Qt::QueuedConnection,
> + Q_ARG(QPlatformWindow*, this),
> + Q_ARG(QString, "persistentSurfaceId"));
>
> Why pass the PlatformWindow, why not the QWindow? I see you only using the
> QWindow in the appmenu stuff:
>
> + connect(nativeInterface,
> &QPlatformNativeInterface::windowPropertyChanged, this,
> [this](QPlatformWindow* window, const QString &property) {
> + if (property != QStringLiteral("persistentSurfaceId")) {
> + return;
> + }
> + if (window->window() == m_window) {
> + registerMenuForWindow(m_window, m_path);
> + }

Because the QPlatformNativeInterface::windowPropertyChanged signal takes a QPlatformWindow,* not a QWindow*.

« Back to merge proposal