mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-05-28 02:50:21 -04:00
50 lines
1.5 KiB
C++
50 lines
1.5 KiB
C++
/*
|
|
* SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
|
* SPDX-FileCopyrightText: 2018 Drew DeVault <sir@cmpwn.com>
|
|
*
|
|
* SPDX-License-Identifier: LGPL-3.0-or-later
|
|
*/
|
|
|
|
#include "qwaylandlayershellintegration_p.h"
|
|
#include "qwaylandlayershell_p.h"
|
|
|
|
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
|
|
|
namespace LayerShellQt {
|
|
|
|
QWaylandLayerShellIntegration::QWaylandLayerShellIntegration() :
|
|
m_layerShell(Q_NULLPTR)
|
|
{
|
|
}
|
|
|
|
bool QWaylandLayerShellIntegration::initialize(QtWaylandClient::QWaylandDisplay *display)
|
|
{
|
|
QWaylandShellIntegration::initialize(display);
|
|
display->addRegistryListener(registryLayer, this);
|
|
return m_layerShell != nullptr;
|
|
}
|
|
|
|
QtWaylandClient::QWaylandShellSurface *QWaylandLayerShellIntegration::
|
|
createShellSurface(QtWaylandClient::QWaylandWindow *window)
|
|
{
|
|
return m_layerShell->createLayerSurface(window);
|
|
}
|
|
|
|
void QWaylandLayerShellIntegration::registryLayer(void *data,
|
|
struct wl_registry *registry, uint32_t id,
|
|
const QString &interface, uint32_t version)
|
|
{
|
|
QWaylandLayerShellIntegration *shell =
|
|
static_cast<QWaylandLayerShellIntegration *>(data);
|
|
|
|
if (interface == QStringLiteral("zwlr_layer_shell_v1"))
|
|
shell->m_layerShell = new QWaylandLayerShell(
|
|
new QtWayland::zwlr_layer_shell_v1(registry, id, version));
|
|
}
|
|
|
|
}
|
|
|
|
//#include "qwaylandlayershellintegration.moc"
|