29d0078909
In the current implementation we cannot use a LayerShellQt before the shell surface is created. At the moment a shell surface is created, the constructor is run and then QtWayland commits the current state. This means the compositor configures the window before a client has any chance to set anchors or margins. This works whilst we're just being a simple fullscreen window, but won't scale for plasmashell in the future. This patch makes LayerShellQt::Window always creatable, and we can set and cache properties before the platform window is created, just like one can on QWindow and XDGShell properties. This also makes it less potentially crashy as ::get always returns a valid result, and sets up the public API to be QML-able as an attached property in future. Co-authored on Aleix's patch for the unit test
21 lines
490 B
C++
21 lines
490 B
C++
/*
|
|
* SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
|
*
|
|
* SPDX-License-Identifier: LGPL-3.0-or-later
|
|
*/
|
|
|
|
#include "shell.h"
|
|
#include <QByteArray>
|
|
#include <layershellqt_logging.h>
|
|
#include <qglobal.h>
|
|
|
|
using namespace LayerShellQt;
|
|
|
|
void Shell::useLayerShell()
|
|
{
|
|
const bool ret = qputenv("QT_WAYLAND_SHELL_INTEGRATION", "layer-shell");
|
|
if (!ret) {
|
|
qCDebug(LAYERSHELLQT) << "Unable to set QT_WAYLAND_SHELL_INTEGRATION=layer-shell";
|
|
}
|
|
}
|