4

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 and wl_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?

Palec
  • 12,743
  • 8
  • 69
  • 138
PhilBot
  • 748
  • 18
  • 85
  • 173

0 Answers0