I have three Qt 5 applications that work fine independently on the BeagleBone X-15 using the Qt 5 Wayland plugin on the TI SDK image.
When I launch them, they fill the whole screen so that the first app launched is covered by the second, and the second app is covered by the third.
How can I modify the transparency of the second and third app launched, so that I can see some of the view from the first app launched?
I tried modifying the window opacity with Qt’s setWindowOpacity
, but the Wayland plugin says: “Window Opacity not supported by this Plugin.”
Qt 5 on Wayland page says:
Qt 5 is structured with the Lighthouse (or Qt Platform) Abstraction, which is the windowing system and device agnostic architecture. That means Qt can load in run-time different backend plugins for different window systems as desired. For instance, an application developed on Qt could be run using "-platform xcb" and "-platform wayland" for XCB or Wayland respectively (or set the
QT_QPA_PLATFORM
environment variable) and should have a similar behavior on both systems, without the need to recompile.Qt abstraction exposes to applications developers two native resources of Wayland:
wl_display
andwl_surface
. With those types, one could access Wayland internals to deal with special cases through the interface:void *QPlatformNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
Getting the display global handler is quite straightforward, as shown in the following example:
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); struct wl_display *wl_dpy = (struct wl_display *) native->nativeResourceForWindow("display", NULL);
and for
wl_surface
:QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); struct wl_surface *surface = static_cast<struct wl_surface *>( native->nativeResourceForWindow("surface", this->windowHandle()));
If I get the handle to this wl_surface
, how can I change the transparency directly?
1 Answers
Answers 1
The transparency implementation depends many factors in QtWayland, such as the following.
1) the format of wl_shm attached to wl_surface suppport alpha channel.
2) the protocol has request defined to specify transparency.
3) the compositor (usually weston) is implemented to support rendering alpha channel.
There is not enough implementation details for your question, but You can check your wayland protocol and compositor implementation to find how to solve it.
0 comments:
Post a Comment