Skip to content
Commit e3cc69f3 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Add support for XDG Foreign

This adds a `KWindowSystem::setMainWindow` overload taking a
`QString` for its parent window which consumes an XDG Foreign
handle.
This also adds an `exportWindow` and `unexportWindow` method to
`KWaylandExtras`.

`exportWindow(window)` asks the compositor for a handle and emits
the `windowExported` signal once it received one. This token can then
be sent to a different application and a window parented to it using
`setMainWindow(window, handle)`.

The wayland objects are parented to the respective `QWaylandWindow`
so that they are cleaned up when the window is destroyed.

Calling `exportWindow` on the same window will re-use the existing
exported object. Even though you can technically export the same window
multiple times and get a separate token each time, this isn't covered
by this API and realistically not its primary use case.

Furthermore, calling `unexportWindow(window)` will delete the
exported object, should one exist on the given window. Calling
`setMainWindow` with an invalid handle will destroy the imported
object, severing the parent-child relationship.
parent a27d1868
Pipeline #559329 passed with stage
in 1 minute and 46 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment