XdgShell QML Type

Provides an extension for desktop-style user interfaces. More...

Import Statement: import QtWayland.Compositor 1.0


  • void ping(object client)

Detailed Description

The XdgShell extension provides desktop functionality such as minimize, maximize, and resize using the xdg-shell protocol. It creates an XdgSurface for each Wayland surface.

The following snippet demonstrates how to use the extension:

import QtQuick 2.6
import QtQuick.Window 2.2
import QtWayland.Compositor 1.0

WaylandCompositor {
    id: wlcompositor
    // The output defines the screen.
    WaylandOutput {
        compositor: wlcompositor
        window: Window {
            width: 1024
            height: 768
            visible: true
            Rectangle {
                id: surfaceArea
                color: "#1337af"
                anchors.fill: parent
    // The chrome defines the window look and behavior.
    // Here we use the built-in ShellSurfaceItem.
    Component {
        id: chromeComponent
        ShellSurfaceItem {
            onSurfaceDestroyed: destroy()
    // Extensions are additions to the core Wayland
    // protocol. We choose to support two different
    // shells (window management protocols). When the
    // client creates a new window, we instantiate a
    // chromeComponent on the output.
    extensions: [
        WlShell {
                chromeComponent.createObject(surfaceArea, { "shellSurface": shellSurface } );
        XdgShell {
                chromeComponent.createObject(surfaceArea, { "shellSurface": xdgSurface } );

Method Documentation

void ping(object client)

Sends a ping event to the client. If the client replies to the event the pong signal will be emitted.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.