feat(wayland): custom layershell implementation

A fair amount of things are broken but not in the layershell interface
itself. The shell window platform extensions are next in line for
refactoring and relevent issues will be fixed then. Same for docs.
This commit is contained in:
outfoxxed 2024-02-24 02:06:40 -08:00
parent b0567a569b
commit 4a82949854
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
21 changed files with 1167 additions and 401 deletions

View file

@ -0,0 +1,48 @@
#pragma once
#include <private/qwaylandshellsurface_p.h>
#include <private/qwaylandwindow_p.h>
#include <qtwaylandclientexports.h>
#include <qtypes.h>
#include <qwayland-wlr-layer-shell-unstable-v1.h>
#include <qwindow.h>
#include "layershell.hpp"
#include "shell_integration.hpp"
class Q_WAYLANDCLIENT_EXPORT QSWaylandLayerSurface
: public QtWaylandClient::QWaylandShellSurface
, public QtWayland::zwlr_layer_surface_v1 {
public:
QSWaylandLayerSurface(
QSWaylandLayerShellIntegration* shell,
QtWaylandClient::QWaylandWindow* window
);
~QSWaylandLayerSurface() override;
QSWaylandLayerSurface(QSWaylandLayerSurface&&) = delete;
QSWaylandLayerSurface(const QSWaylandLayerSurface&) = delete;
void operator=(QSWaylandLayerSurface&&) = delete;
void operator=(const QSWaylandLayerSurface&) = delete;
[[nodiscard]] bool isExposed() const override;
void applyConfigure() override;
void setWindowGeometry(const QRect& geometry) override;
private:
void zwlr_layer_surface_v1_configure(quint32 serial, quint32 width, quint32 height) override;
void zwlr_layer_surface_v1_closed() override;
QWindow* qwindow();
void updateLayer();
void updateAnchors();
void updateMargins();
void updateExclusiveZone();
void updateKeyboardFocus();
LayershellWindowExtension* ext;
QSize size;
bool configured = false;
friend class LayershellWindowExtension;
};