What is the best/preferred way to integrate a Qt application with IVI layer management now?
frederico.cadete at awtce.be
Tue Apr 12 03:23:37 EDT 2016
On Sun, Apr 10, 2016 at 06:52:29PM -0700, Roland Krause wrote:
> So after I got over my problems with Qt applications not showing up solved
> (hurray!) I am trying to figure out what the official best/recommended way
> is to integrate a custom app with the ivi layer management?
> I.e. I'd like to be able to run and control visibility of my own
> application and have it show up on part of the screen or full screen with
> focus etc..
> So far I wrote a script and I am using LayerManagerControl but that seems
> clumsy and I have to restart gdp-hmi-controller.service every time which is
> somewhat slow and even clumsier.
> Another thing I've tried is to replace qml-example with my own application.
> I think I've tried all variations but it seems that my own app can just not
> be handled by the launcher for whatever unknown reason.
> - I tried starting my app with the qml-example.service - nope
> - I tried linking or flat out replacing the binary in /usr/bin with my own
> - nope
> - I have not tried making my own service or hacking the gdp-hmi-launcher2
> code base cause I don't think that would help.
> - My guess is that there is a bit of DBus glue code needed but where can i
> find an example?
> - I found this line in qml-example/main.cpp
> 43: view.setProperty("IVI-Surface-ID", QML_EXAMPLE_SURFACE_ID);
> and am kinda hoping that might help?
> So what would I be missing here?
Maybe you know this already, but here is a cursory explanation of the two
main bits of IVI layer management.
Hopefully it helps you in changing your system to work as you want.
The GENIVI IVI Layer Management has two main components that are used in GDP:
- ivi-shell and ivi_application protocol
- ilm libraries and ivi_controller protocol
The first part has been integrated in upstream weston. It is an alternative
protocol for applications to communicate their "shell" logic with the
compositor, that should be more appropriate for IVI applications than the
desktop-oriented wl_shell and xdg_shell.
The main bit that you should worry about is the surface ID. Every application
must register with the compositor with a surface ID number. From what I see
of the GDP code, the used mechanism is to patch QtWayland to use the
view.setProperty mechanism that you mention.
(a slightly different mechanism has been upstreamed and will be available in Qt5.7)
In your case, I would try setting that property, then use
"LayerManagerControl get surfaces" to make sure that the application is
registering with the intended surface ID. Even if it is not visible on the
screen, this will tell you that you are able to control the application side.
The second part is provided in the wayland-ivi-extension package. It has a
protocol and libraries that allow an external application to control the
compositor and decide which surfaces you want to show. This protocol is
used by LayerManagerControl, and in GDP it is also used by the
It is this gdp-hmi-manager2 that normally controls which surface ID's
are made visible on the screen, and probably you need to modify this to show
your new application if you want to avoid manual control with
LayerManagerControl. I am not sure of the details of this component though.
R&D Software Engineer
VIT Software Development
AWTC Europe - www.aweurope.eu - www.aisin-aw.co.jp
More information about the genivi-ivi-layer-management