[Differential] [Commented On] D1989: Introduce QQuickItem to nest kwin_wayland

graesslin (Martin Gräßlin) noreply at phabricator.kde.org
Thu Jul 7 05:50:26 UTC 2016


graesslin added a comment.


  Looks good now and I think we can look into the next steps: rendering the KWin instance you launch. The launched KWin instance connects to your Wayland server, binds to the Shell and will create a ShellSurface. That you will get through a signal on m_shell - compare wayland_server.cpp:148. I would as a next step try to hook into this and see whether the surface gets created. Once you have that you can look into rendering it.
  
  For that the ShellSurfaceInterface is connected to a SurfaceInterface. The rendering happens on the SurfaceInterface. There's a damaged signal which you should use to trigger a repaint of your QQuickItem. When rendering you can access the buffer on the SurfaceInterface. If KWin uses KWIN_COMPOSE=Q you can access the buffer as a QImage and just render it. Pretty straight forward - hopefully. But first try to see whether you get the ShellSurface created. If not we need to look into what goes wrong.

INLINE COMMENTS

> kwinqml.cpp:73
> +    m_kwinWaylandProcess->setProcessChannelMode(QProcess::ForwardedChannels);
> +    QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
> +    environment.insert(QStringLiteral("WAYLAND_SOCKET"), QString::fromUtf8(QByteArray::number(socket)));

There's one more env variable we should pass to the environment:
KWIN_COMPOSE=Q

In the long run we won't need that, but for the moment I think it makes our life easier. It forces the compositor to use QPainter instead of OpenGL, thus integrating the rendering will be way easier.

> kwinqml.cpp:77-79
> +    QStringList arguments;
> +    arguments << "--xwayland";
> +    arguments << "--socket" << m_socketName;

Please parse the arguments as:

  QStringList arguments{QStringLiteral("--xwayland"), QStringLiteral("--socket"), m_socketName};

That way the list can be constructed in one go and not need to be appended multiple times.

> kwinqml.cpp:80
> +    arguments << "--socket" << m_socketName;
> +    m_kwinWaylandProcess->start(QStringLiteral(KWIN_WAYLAND_BINARY_PATH), arguments);
> +}

I think we need to pass a few more arguments:

- --width
- --height

with the values set to the size of this argument.

> kwinqml.h:61-62
> +
> +    Q_INVOKABLE void start();
> +    Q_INVOKABLE void stop();
> +

I still do not really see the point in those two methods. The start could be handled by implementing the componentComplete method. The stop by calling that from the destructor.

REPOSITORY
  rKWIN KWin

REVISION DETAIL
  https://phabricator.kde.org/D1989

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: bdhruve, bshah, #plasma_on_wayland, graesslin
Cc: bshah, graesslin, plasma-devel, kwin, hardening, jensreuterberg, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160707/81228260/attachment.html>


More information about the Plasma-devel mailing list