summaryrefslogtreecommitdiff
path: root/examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp
blob: b979640a7524e45fc606715f8985852009e7ecb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include "exampleshellintegration.h"
#include "examplesurface.h"

//! [constructor]
ExampleShellIntegration::ExampleShellIntegration()
    : QWaylandShellIntegrationTemplate(/* Supported protocol version */ 1)
{
}
//! [constructor]

//! [createShellSurface]
QWaylandShellSurface *ExampleShellIntegration::createShellSurface(QWaylandWindow *window)
{
    if (!isActive())
        return nullptr;
    auto *surface = surface_create(wlSurfaceForWindow(window));
    return new ExampleShellSurface(surface, window);
}
//! [createShellSurface]