xdg_foreign_unstable_v2 Module

ZxdgImporterV2

class pywayland.protocol.xdg_foreign_unstable_v2.ZxdgImporterV2

Interface for importing surfaces

A global interface used for importing surfaces exported by xdg_exporter. With this interface, a client can create a reference to a surface of another client.

destroy() → 'None'

Request – opcode 0 (attached to Resource instance)

Destroy the xdg_importer object

Notify the compositor that the xdg_importer object will no longer be used.

import_toplevel(handle: 'str') → 'Proxy[ZxdgImportedV2]'

Request – opcode 1 (attached to Resource instance)

Import a toplevel surface

The import_toplevel request imports a surface from any client given a handle retrieved by exporting said surface using xdg_exporter.export_toplevel. When called, a new xdg_imported object will be created. This new object represents the imported surface, and the importing client can manipulate its relationship using it. See xdg_imported for details.

Parameters:handle (ArgumentType.String) – the exported surface handle
Returns:ZxdgImportedV2 – the new xdg_imported object

ZxdgExportedV2

class pywayland.protocol.xdg_foreign_unstable_v2.ZxdgExportedV2

An exported surface handle

An xdg_exported object represents an exported reference to a surface. The exported surface may be referenced as long as the xdg_exported object not destroyed. Destroying the xdg_exported invalidates any relationship the importer may have established using xdg_imported.

destroy() → 'None'

Request – opcode 0 (attached to Resource instance)

Unexport the exported surface

Revoke the previously exported surface. This invalidates any relationship the importer may have set up using the xdg_imported created given the handle sent via xdg_exported.handle.

handle(handle: 'str') → 'None'

Event – opcode 0 (attached to Proxy instance)

The exported surface handle

The handle event contains the unique handle of this exported surface reference. It may be shared with any client, which then can use it to import the surface by calling xdg_importer.import_toplevel. A handle may be used to import the surface multiple times.

Parameters:handle (ArgumentType.String) – the exported surface handle

ZxdgImportedV2

class pywayland.protocol.xdg_foreign_unstable_v2.ZxdgImportedV2

An imported surface handle

An xdg_imported object represents an imported reference to surface exported by some client. A client can use this interface to manipulate relationships between its own surfaces and the imported surface.

destroy() → 'None'

Request – opcode 0 (attached to Resource instance)

Destroy the xdg_imported object

Notify the compositor that it will no longer use the xdg_imported object. Any relationship that may have been set up will at this point be invalidated.

set_parent_of(surface: 'WlSurface') → 'None'

Request – opcode 1 (attached to Resource instance)

Set as the parent of some surface

Set the imported surface as the parent of some surface of the client. The passed surface must be an XdgToplevel equivalent, otherwise an invalid_surface protocol error is sent. Calling this function sets up a surface to surface relation with the same stacking and positioning semantics as XdgToplevel.set_parent().

Parameters:surface (WlSurface) – the child surface
destroyed() → 'None'

Event – opcode 0 (attached to Proxy instance)

The imported surface handle has been destroyed

The imported surface handle has been destroyed and any relationship set up has been invalidated. This may happen for various reasons, for example if the exported surface or the exported surface handle has been destroyed, if the handle used for importing was invalid.

ZxdgExporterV2

class pywayland.protocol.xdg_foreign_unstable_v2.ZxdgExporterV2

Interface for exporting surfaces

A global interface used for exporting surfaces that can later be imported using xdg_importer.

destroy() → 'None'

Request – opcode 0 (attached to Resource instance)

Destroy the xdg_exporter object

Notify the compositor that the xdg_exporter object will no longer be used.

export_toplevel(surface: 'WlSurface') → 'Proxy[ZxdgExportedV2]'

Request – opcode 1 (attached to Resource instance)

Export a toplevel surface

The export_toplevel request exports the passed surface so that it can later be imported via xdg_importer. When called, a new xdg_exported object will be created and xdg_exported.handle will be sent immediately. See the corresponding interface and event for details.

A surface may be exported multiple times, and each exported handle may be used to create an xdg_imported multiple times. Only XdgToplevel equivalent surfaces may be exported, otherwise an invalid_surface protocol error is sent.

Parameters:surface (WlSurface) – the surface to export
Returns:ZxdgExportedV2 – the new xdg_exported object